Files
explore/lib/errors/getErrorObjStatusCode.ts
T
2023-05-10 16:49:30 -03:00

12 lines
276 B
TypeScript

import getErrorObj from './getErrorObj';
export default function getErrorObjStatusCode(error: unknown) {
const errorObj = getErrorObj(error);
if (!errorObj || !('status' in errorObj) || typeof errorObj.status !== 'number') {
return;
}
return errorObj.status;
}