Skip to content

Service exceptions from Java are not properly decoded in Python client #80

@chris05atm

Description

@chris05atm

What happened?

I am using a server conjure service and on exceptions I do not see the errorType deserialized properly.

When a remote exception is throw I get back a payload like this:

  "cause": None,
  "stackTrace": [ REMOVED FROM ISSUE ],
  "errorType": {},
  "args": [],
  "errorInstanceId": "713f5344-e299-41d6-89ff-0244a9a6a8fb",
  "logMessage": "ServiceException: INVALID_ARGUMENT (Workflow:AlertMissingInfo)",
  "message": "ServiceException: INVALID_ARGUMENT (Workflow:AlertMissingInfo)",
  "parameters": [],
  "suppressed": [],
  "localizedMessage": "ServiceException: INVALID_ARGUMENT (Workflow:AlertMissingInfo)"

The errorType parameter is missing above.

My code is not able to deduce the server side errorType for conditional error handling:

if alert_response.failure_response:
        service_exception = alert_response.failure_response.service_exception
        if service_exception['errorType'] != 'Workflow:AlertMissingInfo':
            raise ValueError(f'workflow alert missing info')

Server side is using conjure.java 4.5.0. Client side is using conjure-python-client 1.7.3 build py37_0.

What did you want to happen?

I'd expect errorType to deserialize properly from a Java Conjure service.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions