@directus/errors
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -188,3 +188,6 @@ import { Range } from '@directus/storage'; | ||
declare const LimitExceededError: DirectusErrorConstructor<void>; | ||
interface LimitExceededErrorExtensions { | ||
category: string; | ||
} | ||
declare const LimitExceededError: DirectusErrorConstructor<LimitExceededErrorExtensions>; | ||
@@ -191,0 +194,0 @@ declare const OutOfDateError: DirectusErrorConstructor<void>; |
@@ -152,9 +152,16 @@ // src/create-error.ts | ||
// src/errors/limit-exceeded.ts | ||
var LimitExceededError = createError("LIMIT_EXCEEDED" /* LimitExceeded */, "Limit exceeded.", 403); | ||
var messageConstructor6 = ({ category }) => { | ||
return `${category} limit exceeded.`; | ||
}; | ||
var LimitExceededError = createError( | ||
"LIMIT_EXCEEDED" /* LimitExceeded */, | ||
messageConstructor6, | ||
403 | ||
); | ||
// src/errors/method-not-allowed.ts | ||
var messageConstructor6 = (extensions) => `Invalid method "${extensions.current}" used. Should be one of ${extensions.allowed.map((method) => `"${method}"`).join(", ")}.`; | ||
var messageConstructor7 = (extensions) => `Invalid method "${extensions.current}" used. Should be one of ${extensions.allowed.map((method) => `"${method}"`).join(", ")}.`; | ||
var MethodNotAllowedError = createError( | ||
"METHOD_NOT_ALLOWED" /* MethodNotAllowed */, | ||
messageConstructor6, | ||
messageConstructor7, | ||
405 | ||
@@ -164,3 +171,3 @@ ); | ||
// src/errors/not-null-violation.ts | ||
var messageConstructor7 = ({ collection, field }) => { | ||
var messageConstructor8 = ({ collection, field }) => { | ||
let message = "Value "; | ||
@@ -178,3 +185,3 @@ if (field) { | ||
"NOT_NULL_VIOLATION" /* NotNullViolation */, | ||
messageConstructor7, | ||
messageConstructor8, | ||
400 | ||
@@ -191,3 +198,3 @@ ); | ||
// src/errors/range-not-satisfiable.ts | ||
var messageConstructor8 = ({ range }) => { | ||
var messageConstructor9 = ({ range }) => { | ||
const rangeString = `"${range.start ?? ""}-${range.end ?? ""}"`; | ||
@@ -198,3 +205,3 @@ return `Range ${rangeString} is invalid or the file's size doesn't match the requested range.`; | ||
"RANGE_NOT_SATISFIABLE" /* RangeNotSatisfiable */, | ||
messageConstructor8, | ||
messageConstructor9, | ||
416 | ||
@@ -204,3 +211,3 @@ ); | ||
// src/errors/record-not-unique.ts | ||
var messageConstructor9 = ({ collection, field }) => { | ||
var messageConstructor10 = ({ collection, field }) => { | ||
let message = "Value "; | ||
@@ -218,3 +225,3 @@ if (field) { | ||
"RECORD_NOT_UNIQUE" /* RecordNotUnique */, | ||
messageConstructor9, | ||
messageConstructor10, | ||
400 | ||
@@ -224,10 +231,10 @@ ); | ||
// src/errors/route-not-found.ts | ||
var messageConstructor10 = ({ path }) => `Route ${path} doesn't exist.`; | ||
var RouteNotFoundError = createError("ROUTE_NOT_FOUND" /* RouteNotFound */, messageConstructor10, 404); | ||
var messageConstructor11 = ({ path }) => `Route ${path} doesn't exist.`; | ||
var RouteNotFoundError = createError("ROUTE_NOT_FOUND" /* RouteNotFound */, messageConstructor11, 404); | ||
// src/errors/service-unavailable.ts | ||
var messageConstructor11 = ({ service, reason }) => `Service "${service}" is unavailable. ${reason}.`; | ||
var messageConstructor12 = ({ service, reason }) => `Service "${service}" is unavailable. ${reason}.`; | ||
var ServiceUnavailableError = createError( | ||
"SERVICE_UNAVAILABLE" /* ServiceUnavailable */, | ||
messageConstructor11, | ||
messageConstructor12, | ||
503 | ||
@@ -247,6 +254,6 @@ ); | ||
// src/errors/unprocessable-content.ts | ||
var messageConstructor12 = (extensions) => `Can't process content. ${extensions.reason}.`; | ||
var messageConstructor13 = (extensions) => `Can't process content. ${extensions.reason}.`; | ||
var UnprocessableContentError = createError( | ||
"UNPROCESSABLE_CONTENT" /* UnprocessableContent */, | ||
messageConstructor12, | ||
messageConstructor13, | ||
422 | ||
@@ -256,6 +263,6 @@ ); | ||
// src/errors/unsupported-media-type.ts | ||
var messageConstructor13 = (extensions) => `Unsupported media type "${extensions.mediaType}" in ${extensions.where}.`; | ||
var messageConstructor14 = (extensions) => `Unsupported media type "${extensions.mediaType}" in ${extensions.where}.`; | ||
var UnsupportedMediaTypeError = createError( | ||
"UNSUPPORTED_MEDIA_TYPE" /* UnsupportedMediaType */, | ||
messageConstructor13, | ||
messageConstructor14, | ||
415 | ||
@@ -268,3 +275,3 @@ ); | ||
// src/errors/value-out-of-range.ts | ||
var messageConstructor14 = ({ collection, field }) => { | ||
var messageConstructor15 = ({ collection, field }) => { | ||
let message = "Numeric value "; | ||
@@ -282,3 +289,3 @@ if (field) { | ||
"VALUE_OUT_OF_RANGE" /* ValueOutOfRange */, | ||
messageConstructor14, | ||
messageConstructor15, | ||
400 | ||
@@ -288,3 +295,3 @@ ); | ||
// src/errors/value-too-long.ts | ||
var messageConstructor15 = ({ collection, field }) => { | ||
var messageConstructor16 = ({ collection, field }) => { | ||
let message = "Value "; | ||
@@ -302,3 +309,3 @@ if (field) { | ||
"VALUE_TOO_LONG" /* ValueTooLong */, | ||
messageConstructor15, | ||
messageConstructor16, | ||
400 | ||
@@ -305,0 +312,0 @@ ); |
{ | ||
"name": "@directus/errors", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Create consistent error objects around the codebase", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22640
470