class SendEnvelopeFailureAction implements IAction<IObject> {

    @Override
    public void execute(final IObject actingObject) throws ActionExecuteException, InvalidArgumentException {
        try {
            IObject envelope = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.iobject.IObject"));
            envelope.setValue(messageFieldName, actingObject);
            MessageBus.send(envelope, targetChainId);
        } catch (ResolutionException | ChangeValueException | InvalidArgumentException | SendingMessageException e) {
            try {
                backupAction.execute(actingObject);
            } catch (Exception e1) {
                e.addSuppressed(e1);
            }

            throw new ActionExecuteException("Error occurred sending lost message.", e);
        }
    }

    public  SendEnvelopeFailureAction(final Object targetChainId, final IFieldName messageFieldName, final IAction<IObject> backupAction);

}