FlareError
class FlareError<TDetail extends ErrorSchema<JsonValue> | undefined = undefined> extends ErrorApplication error with a stable name, category, optional numeric code, and exposure flag.
The expose flag governs whether attached detail data may leave the server.
How you get one
Section titled “How you get one”new FlareError(descriptor, args)
Constructor
Section titled “Constructor”new FlareError(descriptor: ErrorCodeDescriptor<TDetail>, ...args: conditional): FlareError<TDetail>Builds a FlareError from a code descriptor and a detail value when a schema is declared.
descriptor ErrorCodeDescriptor<TDetail>
...args conditional
Properties
Section titled “Properties”category
Section titled “category”category: "invalid" | "too_large" | "rejected" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "throttled" | "unavailable" | "fault"code: number | undefinedexpose
Section titled “expose”expose: booleanname: stringAccessors
Section titled “Accessors”detail
Section titled “detail”get detail(): FlareErrorDetail<TDetail> | undefinedReturns the attached detail when expose is true, otherwise undefined.
returns FlareErrorDetail<TDetail> | undefined
rawDetail
Section titled “rawDetail”get rawDetail(): FlareErrorDetail<TDetail> | undefinedReturns the attached detail regardless of the expose flag, for server-side logging.
returns FlareErrorDetail<TDetail> | undefined
Learn: Typed errors