When a call is rejected by inspect_message method, the client receive 403 response code with the body “Requested canister rejected the message”. There seems to be no way to change the returned text to tell the client specifics about the reason for rejection:
Not calling accept_message, trapping with any message, panicking with any message all produce the same result.
Calling something like reject_message produces 500 response code (due to contract violation, this method cannot be called from inspect_message).
So, the question is, do I miss something and there’s some hidden way to return a more specific error message to the client. And if not, is it somewhere on the roadmap?
Error: The replica returned an HTTP Error: Http Error: status 500 Internal Server Error, content type "", content: Canister rrkah-fqaaa-aaaaa-aaaaq-cai trapped explicitly: Trapped!
Are you on dfx 0.10 / is this observable on mainnet? This may have been recently changed in the replica.
Yes, it appears that dfinity was 1 step ahead of me. I was using dfx v0.9.3. With v0.10 the error message is there as expected. Thank you for you help, @AdamS .