Feature Request
Problem
If I attempt to drop a schema referenced by a foreign key constraint, DataJoint returns a pymysql error that is difficult to parse for the average user not familiar with reading the backend snake case. In discussing other code that would catch this error, @dimitri-yatsenko suggested that "external code should not rely on pymysql errors because we may replace pymysql with another database connector"
dj.schema('prefix_abc')
OperationalError: (3730, "Cannot drop table '#a_b_c' referenced by a foreign key constraint '_table_position_ibfk_2' on table '_table_position'.")
Requirements
This feature should catch the underlying OperationalError and translate to camel case for the user as a DataJointError
Justification
Adding this feature would prevent a break in external code if DataJoint replaced pymysql
Alternative Considerations
Current workaround is to try/except the pymyql error
Feature Request
Problem
If I attempt to drop a schema referenced by a foreign key constraint, DataJoint returns a
pymysqlerror that is difficult to parse for the average user not familiar with reading the backend snake case. In discussing other code that would catch this error, @dimitri-yatsenko suggested that "external code should not rely on pymysql errors because we may replace pymysql with another database connector"Requirements
This feature should catch the underlying
OperationalErrorand translate to camel case for the user as aDataJointErrorJustification
Adding this feature would prevent a break in external code if DataJoint replaced
pymysqlAlternative Considerations
Current workaround is to
try/exceptthepymyqlerror