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

Ease CardinalityViolationError debugging #508

Open
Famlam opened this issue May 24, 2024 · 0 comments
Open

Ease CardinalityViolationError debugging #508

Famlam opened this issue May 24, 2024 · 0 comments

Comments

@Famlam
Copy link
Contributor

Famlam commented May 24, 2024

Upon encountering a duplicate entry, frontend crashes with a non-informative message:
"asyncpg.exceptions.CardinalityViolationError: ON CONFLICT DO UPDATE command cannot affect row a second time"
For "normal" mode it's already pretty time-consuming to debug, but for diff mode it's even much more difficult.

Would it be possible to, every time a CardinalityViolationError is encountered, frontend automatically prints a log statement
CardinalityViolationError encountered. Duplicate entry - item: {...} - class: {...} - subclass: {...} - elements: [{...}]
(in case a duplicate error is the cause of course)

Possibly with extra output like diff_mode: {yes|no} and Encountered: {number of times this duplicate exists}, but these are only 'nice to have'.

I suspect it's most efficient to do this on frontend, as there it could be in a try/catch block and only run in case of an actual failure. Naturally it should still make sure the analyser reports a fail, otherwise it won't be detected.

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

1 participant