-
Notifications
You must be signed in to change notification settings - Fork 5
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 error handling when sending a duplicate entry via GraphQL publishEntry
#159
Comments
The error coming from the db is not necessarily a bad thing I think. We don't want to hit the db another time just to check something that a unique index can also catch. But returning a nice and friendly error message that doesn't depend would of course be nice. |
I agree, this is a totally fine pattern! 👍 Still I wonder, shouldn't the bamboo integrity validation throw before? Of course, two identical entries are valid if they are not appended yet, but if one already exists, the seq num and backlink is wrong? |
I haven't checked this myself, so this may be wrong, but is it because we are seeing this always with the first entry in a log? Then I could imagine the first error we hit is "DUPLICATE" for the log id. |
Looking at the verification code, we could probably catch this case here if we make some changes: |
I think We want to do: |
Currently it returns a "DUPLICATE" error coming directly from SQL which makes sense, but I expect the invalid entry to be catched before it hits the database (by checking the log integrity for example).
The text was updated successfully, but these errors were encountered: