mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* custom styles for scrollbar * style scrollbar for search suggest on home page * change overflow for search suggest * fix error screen when API error payload is string e.g. "Internal server error" * add resizer img and styles for FF * update screenshots * update icon for dark theme
10 lines
413 B
TypeScript
10 lines
413 B
TypeScript
import type { ResourceError } from 'lib/api/resources';
|
|
|
|
import getErrorCause from './getErrorCause';
|
|
|
|
export default function getResourceErrorPayload<Payload = Record<string, unknown> | string>(error: Error | undefined):
|
|
ResourceError<Payload>['payload'] | undefined {
|
|
const cause = getErrorCause(error);
|
|
return cause && 'payload' in cause ? cause.payload as ResourceError<Payload>['payload'] : undefined;
|
|
}
|