Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
42762 Widoki

Hi Guys, while importing data from csv file through a customized function, i am getting this error,

current transaction is aborted commands ignored until end of transaction block

I know this is due to some DB operation occuring in a Transaction(where previous operation had some issue in same transaction)

so i can keep and exception to handle this.

But i would like to have a better way to handle this exception or is there any particular exception handler to handle this kind of Exception.

any help would be appreciated.

Awatar
Odrzuć

You should also try looking at the PostgreSQL logs to check what's causing the exception

Najlepsza odpowiedź

ODOO use Psycopg for PostgreSQL connection .
You can  place your code inside the try catch block and

  Use psycopg2.Error  or psycopg2. IntregrityError   for exception handling .

Hope this may help in your case.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
sie 25
2107
1
lip 25
676
1
sie 25
1150
0
maj 25
1243
2
kwi 25
3368