Skip to content

IsSuccessful in RestResponse is true when deserialization fails #1892

Closed

Description

@mjuen

Describe the bug
When using RestSharp v107+ IsSuccessful in RestResponse remains true even when an exception like an unsuccessful deserialization occurs. As this is a major change to the old behavior, which is going to affect a lot of projects that use this library, I checked the migration guide and the documentation for this change but could not find anything about it. Therefor I assume this is a bug.

To Reproduce

  1. Start a HTTP server that returns a success status code and an invalid JSON as content
  2. Create a RestRequest that queries the HTTP server and tries to parse the JSON into an object
  3. Check IsSuccessful -> is true even though an exception is present in ErrorException

Expected behavior
IsSuccessful should be false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions