Closed coderDGJ closed 2 years ago
class ApiError extends Error { code: number = 0; } class HttpError extends Error { statusCode: number = 200; }
function isApiError(error: Error) { if (typeof (error as ApiError).code === 'number') { return true; } return false; }
class ApiError extends Error { code: number = 0; } class HttpError extends Error { statusCode: number = 200; }
function isApiError(error: Error) { if (typeof (error as ApiError).code === 'number') { return true; } return false; }