Create exception class for invalid data from client

Created on 14 November 2024, about 1 month 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

Comments & Activities

Production build 0.71.5 2024