import type { StatusCodes as StatusCode } from 'http-status-codes' ; import type { BackendErrorLabel } from '../http/' ; import { SyntheticErrorLabel } from './BackendErrorLabel' ; export class BackendError extends Error { code ? : StatusCode ; label : BackendErrorLabel | SyntheticErrorLabel ; message : string ; constructor ( message , label = SyntheticErrorLabel . UNKNOWN , code ? ) { super ( message ) ; this . code = code ; this . label = label ; this . message = message ; Object . setPrototypeOf ( this , new . target . prototype ) ; } }