Create exception class for invalid data from client

Created on 14 November 2024, 6 months ago

Overview

In AutoSave Entity Revision POC Active @wim leers suggested create a new exception class

These two may throw an UnprocessableHttpEntityException, which can carry errors, see \Drupal\jsonapi\Exception\UnprocessableHttpEntityException::setViolations() for an example. Here, they wouldn't be constraint violations, but just "errors".

I, tedbow, hope we can do that in this follow-up

Proposed resolution

Create a new exception class UnprocessableHttpEntityException similar to `\Drupal\jsonapi\Exception\UnprocessableHttpEntityException` except that it would have a setErrors method instead of setViolations

We could have override getMessages() to construct 1 message with all the errors

User interface changes

📌 Task
Status

Active

Version

0.0

Component

Code

Created by

🇺🇸United States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024