Add utilities for using TUS Protocol

Co-authored-by: Scott Nonnenberg <scott@signal.org>
Co-authored-by: Fedor Indutny <indutny@signal.org>
This commit is contained in:
Jamie Kyle 2024-04-30 17:57:57 -07:00 committed by GitHub
parent 794eeb2323
commit 8ef0ec706d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 1098 additions and 0 deletions

View file

@ -25,6 +25,14 @@ export class HTTPError extends Error {
public readonly response: unknown;
static fromResponse(response: Response): HTTPError {
return new HTTPError(response.statusText, {
code: response.status,
headers: Object.fromEntries(response.headers),
response,
});
}
constructor(
message: string,
options: {