Skip to content

Do not store error if context/occurrence is not valid #66

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

Merged
merged 2 commits into from
Aug 24, 2024

Conversation

odarriba
Copy link
Contributor

This change solves an issue in which an invalida content of the error context
case the Error schema to be stored but not the Occurrence, which means that
the error appears on the dashboard list but cannot be opened because the details
were not stored.

On this change I change the store procedure to use a DB transaction and ensure
that, if something fails, no data is stored and an exception is generated.

I thought about storing that exception ourselves but if the issue is not related
to the data stored but other parts of the stack (network, DB, etc) it can end up
in an infinite loop.

I have also updated the documentation so it states the requirements needed for
the context data to be stored (basically, it has to be convertible to JSON).

Closes #65

@odarriba odarriba self-assigned this Aug 24, 2024
@odarriba odarriba force-pushed the do-not-store-error-if-occurrence-is-not-valid branch from 67b7684 to 75a3e47 Compare August 24, 2024 13:36
@odarriba odarriba requested a review from crbelaus August 24, 2024 13:37
Copy link
Contributor

@crbelaus crbelaus left a comment

Choose a reason for hiding this comment

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

This change makes sense IMHO.

@crbelaus crbelaus merged commit 2c158b2 into main Aug 24, 2024
3 checks passed
@crbelaus crbelaus deleted the do-not-store-error-if-occurrence-is-not-valid branch August 24, 2024 17:29
@jaimeiniesta
Copy link

Hey, that's nice, I just tried to put the whole User struct and I got this, as expected. Good work, thanks!

Captura de pantalla 2024-09-02 a las 16 29 29

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

Successfully merging this pull request may close these issues.

Error when setting a User struct in the error context
3 participants