Skip to content

Add InvalidEntryException#174

Open
oknate wants to merge 1 commit intocontentful:masterfrom
oknate:hotfix
Open

Add InvalidEntryException#174
oknate wants to merge 1 commit intocontentful:masterfrom
oknate:hotfix

Conversation

@oknate
Copy link

@oknate oknate commented Mar 27, 2023

When there is a validation error message, you can't view the entire message in a catch statement easily:
before:

$body = Utils::jsonDecode($e->getPrevious()->getResponse()->getBody());
                        if (!empty($body?->sys?->id) && $body->sys->id === 'InvalidEntry') {
                            $details['errors'] = $body->details->errors;
                        }

after:

if ($e instanceof InvalidEntryException) {
          $details['errors'] = $e->getErrors();
      }

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

Successfully merging this pull request may close these issues.

1 participant