Files
automatisch/packages/backend/src/errors/http.ts
2022-11-07 22:51:30 +01:00

13 lines
326 B
TypeScript

import { IJSONObject } from '@automatisch/types';
import BaseError from './base';
export default class HttpError extends BaseError {
constructor(error: IJSONObject) {
const computedError =
((error.response as IJSONObject)?.data as IJSONObject) ||
(error.message as string);
super(computedError);
}
}