feat(SW-159): merged contentstack and api requests for hotel query
This commit is contained in:
@@ -59,3 +59,17 @@ export function publicUnauthorizedError() {
|
||||
cause: new PublicUnauthorizedError(PUBLIC_UNAUTHORIZED),
|
||||
})
|
||||
}
|
||||
|
||||
export function serverErrorByStatus(status: number, cause?: unknown) {
|
||||
switch (status) {
|
||||
case 401:
|
||||
return unauthorizedError(cause)
|
||||
case 403:
|
||||
return forbiddenError(cause)
|
||||
case 404:
|
||||
return notFound(cause)
|
||||
case 500:
|
||||
default:
|
||||
return internalServerError(cause)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user