Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action context to contract error message #1744

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void apply_context::exec_one()
}
}
}
} FC_RETHROW_EXCEPTIONS( warn, "pending console output: ${console}", ("console", _pending_console_output) )
} FC_RETHROW_EXCEPTIONS( warn, "${account}::${action} @ ${receiver} pending console output: ${console}", ("console", _pending_console_output)("account", act->account)("action", act->name)("receiver", receiver) )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleos outputs this as ${receiver} <= ${account}::${action}. I'm not sure it matters much but would be interested if anyone has a preference. @arhag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference how those three pieces of information should be presented. I agree it is a great developer experience improvement to include it though in whichever from.

I'm wondering if we should also include the action_ordinal to disambiguate which one it comes from if there were multiple instances of the same action and receiver. But then again, even without this change, the transaction trace should already have enough information to determine which exact action within the trace the error came from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to ${receiver} <= ${account}::${action}.

I feel like the meaning of action_ordinal number would be hard to figure out for the developers, so would be more confusing than helpful. But maybe it's just me.


if( control.is_builtin_activated( builtin_protocol_feature_t::action_return_value ) ) {
act_digest = generate_action_digest(
Expand Down