MCPcopy
hub / github.com/NginxProxyManager/nginx-proxy-manager / processResponse

Function processResponse

frontend/src/api/backend/base.ts:49–63  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

47}
48
49async function processResponse(response: Response) {
50 const payload = await response.json();
51 if (!response.ok) {
52 if (response.status === 401) {
53 // Force logout user and reload the page if Unauthorized
54 AuthStore.clear();
55 queryClient.clear();
56 window.location.reload();
57 }
58 throw new Error(
59 typeof payload.error.messageI18n !== "undefined" ? payload.error.messageI18n : payload.error.message,
60 );
61 }
62 return camelizeKeys(payload) as any;
63}
64
65interface GetArgs {
66 url: string;

Callers 4

getFunction · 0.85
postFunction · 0.85
putFunction · 0.85
delFunction · 0.85

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected