DIRACGrid / DIRACGrid/diracx

SQLAlchemy bad error handling

Open
#450 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
19
Forks
45
Avg merge
4d 23h
Merged PRs (30d)
12

Description

SQLAlchemy doesn't give us the right "confort" for error handling. We need to handle it depending on which db engine we are using, and we need to use test like `"text in the error detail" in e.details`. For later, we'll need to find a better way.

# Context from PR

If we check if an error is an instance of another module `pymysql` we *could potentially* catch some errors as code that are specific on a `db`. And even with that, I saw errors where people had to use both `IntegrityError` from sql-alchemy and `pymy` integrity error because of a bad handling..

It is not pretty, and you can read this response: https://stackoverflow.com/a/70714697

_Originally posted by @Robin-Van-de-Merghel in https://github.com/DIRACGrid/diracx/pull/421#discussion_r2028828354_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.