Skip to content

When parsing an error body allow for non-parsing error bodies #308

@ryber

Description

@ryber

Describe the bug
The error mapper function expects the only possibly source of a body to parse would be in the parsing exception. This is not the case if the body actually parsed correctly or the Object Mapper was extra laissez faire

To Reproduce

   @Test
    public void parsingAnAlternativeErrorObject_StringBody() {
        ErrorThing e = Unirest.get(MockServer.ERROR_RESPONSE)
                .asString()
                .mapError(ErrorThing.class);

        assertErrorThing(e);
    }

Metadata

Metadata

Assignees

Labels

BugOh Noes! A bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions