Skip to content

Commit

Permalink
Got missing error message
Browse files Browse the repository at this point in the history
  • Loading branch information
satr committed Jan 15, 2025
1 parent 1ef78ef commit d5cb1fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/store/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ export function getFetchErrorData(error: ManagedErrors): {

if (IsRTKQueryError(error)) {
const code = isFetchBaseQueryError(error) ? error.status : IsParsingError(error) ? error.originalStatus : undefined;
let errorMessage = error?.error??error?.data?.error;

Check failure on line 33 in src/store/utils/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Property 'error' does not exist on type 'FetchBaseQueryError'.

Check failure on line 33 in src/store/utils/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Property 'error' does not exist on type '{}'.
return {
code: code,
error: isFetchBaseQueryError(error) ? "server error" : error.error,
message: "failed to fetch data: " + (code ? getReasonPhrase(code) : "unknown")
error: errorMessage,
message: "failed to fetch data: " + (code ? getReasonPhrase(code) : "unknown") + (errorMessage ? ". " + errorMessage : "")
}
}

Expand Down

0 comments on commit d5cb1fe

Please sign in to comment.