Skip to content

Identify REST exception origin #751

@ChrnyaevEK

Description

@ChrnyaevEK

We are currently dealing with issue - when calling scene_service.start(), this call might take too long (longer then defined 20s. rest timeout) and then will consequently fail with RestException as timeout will happen. We would like to add an opportunity to easily identify the origin of the error for each rest.call call (scene service client in this case).

Proposed solution

When rest.call raise any exception it get's converted by arcor2.exceptions.helpers.handle to SceneServiceException. However, not all service clients has such conversion implemented. Moreover, this logic must be changed after new API convention is implemented as it hides WebApiError properties (convert WebApiError to string to raise required exception type).

It would be enough to implement a function that will accept service unique exception (for scene service it would be SceneServiceException) and will return wrapped rest.call function. Wrapper will catch only RestException exceptions and raise desired type from it (just like arcor2.exceptions.helpers.handle does).

Each client that will want to mark rest error origin will request wrapped rest.call and use it as usually.

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