Function
makeErrorResponse
(status, statusText, retryAfterSec = null)
Source from the content-addressed store, hash-verified
| 50 | } |
| 51 | |
| 52 | function makeErrorResponse(status, statusText, retryAfterSec = null) { |
| 53 | return { |
| 54 | ok: false, |
| 55 | status, |
| 56 | statusText, |
| 57 | headers: { |
| 58 | get: (name) => |
| 59 | name.toLowerCase() === "retry-after" && retryAfterSec !== null |
| 60 | ? String(retryAfterSec) |
| 61 | : null, |
| 62 | }, |
| 63 | }; |
| 64 | } |
| 65 | |
| 66 | // --------------------------------------------------------------------------- |
| 67 | // Mock fetch utility |
Tested by
no test coverage detected