mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
docs(routes): tighten the outage comments and notes
Shorter comments, changelog and CURRENT-STATE text for the 502 outage path; the CURRENT-STATE paragraph now also names the 429 exception and which budget expiry answers busy and which answers 502. Text only.
This commit is contained in:
1 parent
a29611ca17
commit
82e2b716bc
7 files changed
+20
-36
No files matched your search
@@ -21,7 +21,7 @@ export function createDirectionsSource({
|
||||
signal,
|
||||
headers: { Accept: 'application/json' },
|
||||
});
|
||||
// A failure page in front of the proxy need not be JSON.
|
||||
// Proxy error pages may not be JSON.
|
||||
let payload = null;
|
||||
try {
|
||||
payload = await response.json();
|
||||
@@ -45,8 +45,7 @@ export function createDirectionsSource({
|
||||
{ status: 429, refusal },
|
||||
);
|
||||
}
|
||||
// A 5xx is a routing outage whatever its body says; only the proxy's
|
||||
// refusals carry an error text worth showing.
|
||||
// A 5xx body may mislabel an outage as a route refusal.
|
||||
if (response.status >= 500 || (!response.ok && !payload?.error))
|
||||
throw Object.assign(
|
||||
new Error(`Routing unavailable (HTTP ${response.status})`),
|
||||
|
||||
Reference in new issue
Block a user