-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(upload-client): rename
UploadClientError
export to the `Upload…
…Error`. `UploadClientError` is deprecated but still available
- Loading branch information
Showing
32 changed files
with
136 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 7 additions & 8 deletions
15
packages/upload-client/src/tools/errors.ts → ...es/upload-client/src/tools/UploadError.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
import { UploadcareError } from '@uploadcare/api-client-utils' | ||
import { Headers, ErrorRequestInfo } from '../request/types' | ||
import type { ServerErrorCode } from './ServerErrorCode' | ||
|
||
export type ErrorResponseInfo = { | ||
error?: { | ||
statusCode: number | ||
content: string | ||
errorCode: string | ||
errorCode: ServerErrorCode | ||
} | ||
} | ||
|
||
export class UploadClientError extends UploadcareError { | ||
isCancel?: boolean | ||
|
||
readonly code?: string | ||
export class UploadError extends UploadcareError { | ||
readonly code?: ServerErrorCode | ||
readonly request?: ErrorRequestInfo | ||
readonly response?: ErrorResponseInfo | ||
readonly headers?: Headers | ||
|
||
constructor( | ||
message: string, | ||
code?: string, | ||
code?: ServerErrorCode, | ||
request?: ErrorRequestInfo, | ||
response?: ErrorResponseInfo, | ||
headers?: Headers | ||
) { | ||
super() | ||
|
||
this.name = 'UploadClientError' | ||
this.name = 'UploadError' | ||
this.message = message | ||
this.code = code | ||
this.request = request | ||
this.response = response | ||
this.headers = headers | ||
|
||
Object.setPrototypeOf(this, UploadClientError.prototype) | ||
Object.setPrototypeOf(this, UploadError.prototype) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.