mirror of
https://github.com/JonasunderscoreJones/api.jonasjones.dev.git
synced 2025-10-22 19:59:17 +02:00
Added fallback for code 530
This commit is contained in:
parent
f138451053
commit
b17bd1c406
1 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,12 @@ addEventListener('fetch', event => {
|
||||||
status: 420,
|
status: 420,
|
||||||
statusText: 'API Backend Downtime Error'
|
statusText: 'API Backend Downtime Error'
|
||||||
});
|
});
|
||||||
|
} else if (apiResponse.status === 530) {
|
||||||
|
// If the API request fails, return an error response
|
||||||
|
return new Response('API backend went down just now :( It should be back up in a matter of seconds!', {
|
||||||
|
status: 421,
|
||||||
|
statusText: 'API Backend Downtime Error'
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// If the API request fails, return the API response
|
// If the API request fails, return the API response
|
||||||
return apiResponse;
|
return apiResponse;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue