mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
7 lines
277 B
TypeScript
7 lines
277 B
TypeScript
import getErrorCause from './getErrorCause';
|
|
|
|
export default function getErrorStatusCode(error: Error | undefined): number | undefined {
|
|
const cause = getErrorCause(error);
|
|
return cause && 'status' in cause && typeof cause.status === 'number' ? cause.status : undefined;
|
|
}
|