import { IJsonApiError } from "./interfaces"; import { ExtendableError } from "extendable-error" export default class JsonApiError extends ExtendableError implements IJsonApiError { id?: string; status?: string; code?: string; title?: string; detail?: string; source?: { pointer?: string; parameter?: string; }; constructor(options: IJsonApiError) { const message = options.detail || options.title; super(message); Object.assign(this, options); } }