@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
15 lines (12 loc) • 384 B
text/typescript
import { log } from "@ledgerhq/logs";
import type { NamedSchemaError } from "@reduxjs/toolkit/query";
type SchemaFailureHandler = {
apiName: string;
endpoint: string;
error: NamedSchemaError;
};
export const onSchemaFailure = ({ apiName, endpoint, error }: SchemaFailureHandler) => {
log(apiName, `Invalid ${endpoint} response schema:`, {
issues: error.issues,
});
};