-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add action context to contract error message #1744
Conversation
libraries/chain/apply_context.cpp
Outdated
@@ -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) ) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Thank you @YaroShkvorets |
Note:start |
Curious @heifner is it too late to merge this into |
Looks like little to no risk for this one. @YaroShkvorets please merge it to |
Thanks. Opened: #1902 |
This PR addresses #1743
I'm adding
contract::action @ receiver
in front ofpending console output
but let me know if there are other considerations.