MCPcopy Index your code
hub / github.com/FeatureProbe/FeatureProbe / checkStatus

Function checkStatus

ui/src/utils/request.ts:8–24  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

6}
7
8function checkStatus(response: Response) {
9 if (
10 (response.status >= 200 && response.status < 300)
11 || response.status === 400
12 || response.status === 403
13 ) {
14 return response;
15 }
16 else if (response.status === 401) {
17 window.location.href = '/login';
18 return response;
19 }
20 else {
21 const error: Error = new Error(response.statusText);
22 throw error;
23 }
24}
25
26type IResponse<T> = {
27 success: boolean;

Callers 4

requestFunction · 0.85
AccessToggleFunction · 0.85
AccessEventFunction · 0.85
TestConnectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected