OpenApiError.ts 491 B

123456789101112131415161718192021
  1. export class OpenApiError extends Error {
  2. _status : number | null;
  3. _error : Error | null;
  4. public constructor(value : Response | Error, message? : string) {
  5. super(message);
  6. this._status = (value instanceof Error) ? null : value.status;
  7. this._error = (value instanceof Error) ? value : null;
  8. }
  9. public get status() : number | null {
  10. return this._status;
  11. }
  12. public get error() : Error | null {
  13. return this._error;
  14. }
  15. }