different exception type
See original GitHub issuehi
with postgres database connection, exception raised as psycopg2.IntegrityError
but its not same as peewee.IntegrityError
and not catchable.
it is normal to use psycopg2.IntegrityError
in except ?
for example:
try:
model.save()
except psycopg2.IntegrityError:
raise
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Types of Exception in Java with Examples - GeeksforGeeks
Built-in Exceptions: · ArithmeticException: It is thrown when an exceptional condition has occurred in an arithmetic operation.
Read more >Types of Exceptions in Java - Stackify
Exceptions are the unwanted errors or bugs or events that restrict the normal execution of a program. Each time an exception occurs, program ......
Read more >What are different types of exceptions in Java? - Educative.io
The Throwable class is the superclass of all exceptions and errors in Java. All other exception classes are subclasses of the Throwable.
Read more >Types of Exceptions - w3resource
All exception types are subclasses of the built-in class Throwable. Thus, Throwable is at the top of the exception class hierarchy. Immediately ...
Read more >Exception Handling in Java - Javatpoint
Advantage of Exception Handling · Types of Java Exceptions · 1) Checked Exception · 2) Unchecked Exception · 3) Error · 1) A...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you are using Postgres, you need to take care that, if you get the connection into a bad state – i.e., by an IntegrityError – you need to rollback. Auto-rollback will issue the rollback automatically, but it’s better, in my opinion, to manage the transaction yourself:
hey, i tested again and its worked 😃 but if i set
autorollback
to false, problem will be appear.