MCPcopy Create free account
hub / github.com/Levofron/NotionLingo / getErrorMessageFromAxiosResponse

Function getErrorMessageFromAxiosResponse

client/shared/axios.instance.ts:21–27  ·  view source on GitHub ↗
(error: AxiosError)

Source from the content-addressed store, hash-verified

19const getErrorMessageFromAxiosRequest = (error: AxiosError) => error.message;
20
21const getErrorMessageFromAxiosResponse = (error: AxiosError) => {
22 const { data } = error.response!;
23
24 if (data && hasOwnProperty(data, 'message')) {
25 return data.message as string;
26 }
27};
28
29axiosInstance.interceptors.response.use(
30 (response) => response,

Callers 1

axios.instance.tsFile · 0.85

Calls 1

hasOwnPropertyFunction · 0.90

Tested by

no test coverage detected