mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
BREAKING CHANGE: This changes the `name` property of a small number of error responses that we return. The property would have been `TypeError`, but is now `ValidationError` instead. It's a grey area, but I'd rather be strict. --- This change removes uses of the `TypeError` type from user-facing code. Type errors are used by typescript when you provide it the wrong type. This is a valid concern. However, in the API, they're usually a signal that **we've** done something wrong rather than the user having done something wrong. As such, it makes more sense to return them as validation errors or bad request errors. ## Breaking changes Note that because of the way we handle errors, some of these changes will be made visible to the end user, but only in the response body. ```ts { "name": "TypeError", "message": "Something is wrong", "isJoi": true } ``` will become ```ts { "name": "ValidationError", "message": "Something is wrong", "isJoi": true } ``` Technically, this could be considered a breaking change. However, as we're gearing up for v5, this might be a good time to merge that? ## A return to 500 This PR also makes TypeErrors a 500-type error again because they should never be caused by invalid data provided by the user |
||
---|---|---|
.. | ||
models | ||
settings | ||
stores | ||
api-user.ts | ||
authentication-required.ts | ||
core.ts | ||
environment.ts | ||
events.ts | ||
experimental.ts | ||
favorites.ts | ||
group.ts | ||
index.ts | ||
model.ts | ||
mutable.ts | ||
no-auth-user.ts | ||
openapi.d.ts | ||
option.ts | ||
partial.ts | ||
permissions.ts | ||
project.ts | ||
query.ts | ||
saved.ts | ||
serialize-dates.test.ts | ||
serialize-dates.ts | ||
services.ts | ||
stores.ts | ||
user.test.ts | ||
user.ts |