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:
parent
794eeb2323
commit
8ef0ec706d
5 changed files with 1098 additions and 0 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue