Python API Dataiku Exceptions import/reference

Options
JohnB
JohnB Registered Posts: 32 ✭✭✭✭✭

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

Best Answer

  • Clément_Stenac
    Clément_Stenac Dataiker, Dataiku DSS Core Designer, Registered Posts: 753 Dataiker
    Answer ✓
    Options

    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.

Answers

  • JohnB
    JohnB Registered Posts: 32 ✭✭✭✭✭
    Options

    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

Setup Info
    Tags
      Help me…