Skip to content

Not all 400 errors return a JSON response #6

@jackbentley

Description

@jackbentley

It looks like some 4XX errors returned from Citadel sometimes don't contain a JSON response and have a blank response instead. I'm not sure what 4XX code this happens on but in the instance I found it's when we pass a token with the value undefined.

The code expects a JSON response with error details. However because there is none it throws a MalformedPayloadException which is confusing

citadel-php/src/Client.php

Lines 127 to 129 in 7eb2d66

if ($statusCode >= 400) {
ExceptionFactory::generateExceptionFromResponse($response);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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