Announcing the winners & finalists of the Dataiku Frontrunner Awards 2021! Read their inspiring stories

Python API Dataiku Exceptions import/reference

Solved!
JohnB
Level 3
Python API Dataiku Exceptions import/reference

If I want to trap a specific exception that gets raised when using the Python API, how do I import that exception to use in the try..except block?

Specifically, I want to trap this:

com.dataiku.common.server.APIError$SerializedErrorException

0 Kudos
1 Solution
Clément_Stenac
Dataiker
Dataiker

Hi,

"SerializedErrorException" is a generic exception that indicates that something wrong happened in your call on the server side

All such server side issues are thrown as a DataikuException object. You cannot specifically except on a specific exception, so you'd need to parse the message of the DataikuException itself depending on what exactly you are trying to achieve.

View solution in original post

0 Kudos
2 Replies
Clément_Stenac
Dataiker
Dataiker

Hi,

"SerializedErrorException" is a generic exception that indicates that something wrong happened in your call on the server side

All such server side issues are thrown as a DataikuException object. You cannot specifically except on a specific exception, so you'd need to parse the message of the DataikuException itself depending on what exactly you are trying to achieve.

View solution in original post

0 Kudos
JohnB
Level 3
Author

 Hi Clément,

Thanks for the response. This is in relation to a support ticket  #26358.

Looking how to trap the exception so that we can retry the query. We usually avoid trapping the generic "Exception" exception.

Regards,

John

0 Kudos
A banner prompting to get Dataiku DSS