Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rue-vmom opened this issue Jun 5, 2020 · 0 comments

Comments

@rue-vmom
Copy link

rue-vmom commented Jun 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant