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

Improve storage errors #1008

Closed
2opremio opened this issue Aug 21, 2023 · 5 comments
Closed

Improve storage errors #1008

2opremio opened this issue Aug 21, 2023 · 5 comments

Comments

@2opremio
Copy link
Contributor

2opremio commented Aug 21, 2023

When calling host.invoke_function(), if a ledger entry is missing (e.g. due to a badly constructed contract invocation), the following error message is returned:

HostError: Error(Storage, MissingValue)
DebugInfo not available

(note that this is before invoking host.try_finish() and thus there are no diagnostic events).

I would expect the error to tell me the key of the missing ledger entry. Also, (Storage, MissingValue) isn't helpful since it doesn't tell the user it's a LedgerEntry which is missing.

In general, I think any errors returned by host.invoke_function() before try_finish() should be descriptive and add context, since there are no diagnostic events.

@2opremio
Copy link
Contributor Author

CC @dmkozh

@2opremio
Copy link
Contributor Author

2opremio commented Aug 21, 2023

I have seen that I can recover diagnostic events in try_finish() even if invoke_function() fails (which is awkward).

But even then, the diagnostic events are not useful.

Here's the XDR of the only event returned:

AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgAQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAE=

@2opremio
Copy link
Contributor Author

Here's the unmarshalled event:

Screenshot 2023-08-21 at 03 07 04

@anupsdf
Copy link
Contributor

anupsdf commented Sep 12, 2023

Hi @2opremio, Can you re-evaluate this with latest preview 11 build, please.

@anupsdf
Copy link
Contributor

anupsdf commented Jun 17, 2024

This can be closed since we are have lot of improved error handling. Please open a new issue if there are any other areas we can improve.

@anupsdf anupsdf closed this as completed Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@2opremio @anupsdf and others