From 46f925663e595fa8dd87f7aa15a0061abcfae3d7 Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Mon, 2 Sep 2024 16:27:12 -0700 Subject: Add ui error messages --- client/src/error.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 client/src/error.ts (limited to 'client/src/error.ts') diff --git a/client/src/error.ts b/client/src/error.ts new file mode 100644 index 0000000..8935e23 --- /dev/null +++ b/client/src/error.ts @@ -0,0 +1,11 @@ +import type { FetchBaseQueryError } from '@reduxjs/toolkit/query/react'; + +export const isFetchBaseQueryError = ( + error: any +): error is FetchBaseQueryError => { + return 'data' in error && 'message' in error.data; +}; + +export interface Data { + message: string; +} -- cgit v1.2.3