Skip to content

Calling PartlyRefund() with an invalid order id results in an ObjectDisposedException. #59

@rue-vmom

Description

@rue-vmom

Looks like when an invalid order id is passed in, the services return a 404 with a JSON body of:

{"error":{"message":"An order with id: '123456789' doesn't exist in the system"}}

I don't understand the purpose of this line, but during JSON deserialization, it throws a cast exception here: https://github.com/Riskified/sdk_net/blob/master/Riskified.SDK/Utils/HttpUtils.cs#L201

Object of type 'System.String' cannot be converted to type 'Riskified.SDK.Utils.HttpUtils+ErrorMessage'.

The JSON parsing code closes the response stream here: https://github.com/Riskified/sdk_net/blob/master/Riskified.SDK/Utils/HttpUtils.cs#L186

The exception bubbles up to: https://github.com/Riskified/sdk_net/blob/master/Riskified.SDK/Utils/HttpUtils.cs#L115
which throws the ObjectDisposedException exposed to the client.

I think the issue is that when the response was closed earlier it was also disposed of.

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