Skip to content
This repository was archived by the owner on May 2, 2019. It is now read-only.
This repository was archived by the owner on May 2, 2019. It is now read-only.

Improve handling of API error responses #2

@jordanmkoncz

Description

@jordanmkoncz

I've been getting an error response from the API (see https://github.com/moltin/issues/issues/22 for more info). The way that Moltin's Python SDK currently handles error responses from the API meant that the only thing that was being displayed in the console was the following:

RequestError: billing_address

This is obviously not very informative and I spent a while passing different variations of data to Moltin hoping to get a successful response back. After no success I dropped into debug mode and set a breakpoint so that I could view the raw response from the API, which turned out to be the following:

{
    'status': False,
    'errors': {
        'billing_address': ["Address 'postcode' not found"]
    }
}

I think the error handling in the with_error_handling() function should be improved so that when there is an error response from the API, the output to console includes all the error information provided by the API.

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