mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
Fixed unit test
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
// @flow
|
||||
import {contextPath} from "./urls";
|
||||
|
||||
export const NOT_FOUND_ERROR = Error("not found");
|
||||
export const UNAUTHORIZED_ERROR = Error("unauthorized");
|
||||
export const NOT_FOUND_ERROR_MESSAGE = "not found";
|
||||
export const UNAUTHORIZED_ERROR_MESSAGE = "unauthorized";
|
||||
|
||||
const fetchOptions: RequestOptions = {
|
||||
credentials: "same-origin",
|
||||
@@ -15,9 +15,9 @@ function handleStatusCode(response: Response) {
|
||||
if (!response.ok) {
|
||||
switch (response.status) {
|
||||
case 401:
|
||||
return throwErrorWithMessage(response, UNAUTHORIZED_ERROR.message);
|
||||
return throwErrorWithMessage(response, UNAUTHORIZED_ERROR_MESSAGE);
|
||||
case 404:
|
||||
return throwErrorWithMessage(response, NOT_FOUND_ERROR.message);
|
||||
return throwErrorWithMessage(response, NOT_FOUND_ERROR_MESSAGE);
|
||||
default:
|
||||
return throwErrorWithMessage(response, "server returned status code " + response.status);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export { default as HelpIcon } from "./HelpIcon";
|
||||
export { default as Tooltip } from "./Tooltip";
|
||||
export { getPageFromMatch } from "./urls";
|
||||
|
||||
export { apiClient, NOT_FOUND_ERROR, UNAUTHORIZED_ERROR } from "./apiclient.js";
|
||||
export { apiClient, NOT_FOUND_ERROR_MESSAGE, UNAUTHORIZED_ERROR_MESSAGE } from "./apiclient.js";
|
||||
|
||||
export * from "./buttons";
|
||||
export * from "./config";
|
||||
|
||||
Reference in New Issue
Block a user