45 lines
1.7 KiB
TypeScript
45 lines
1.7 KiB
TypeScript
export declare enum QiniuErrorName {
|
|
InvalidFile = "InvalidFile",
|
|
InvalidToken = "InvalidToken",
|
|
InvalidMetadata = "InvalidMetadata",
|
|
InvalidChunkSize = "InvalidChunkSize",
|
|
InvalidCustomVars = "InvalidCustomVars",
|
|
NotAvailableUploadHost = "NotAvailableUploadHost",
|
|
ReadCacheFailed = "ReadCacheFailed",
|
|
InvalidCacheData = "InvalidCacheData",
|
|
WriteCacheFailed = "WriteCacheFailed",
|
|
RemoveCacheFailed = "RemoveCacheFailed",
|
|
GetCanvasContextFailed = "GetCanvasContextFailed",
|
|
UnsupportedFileType = "UnsupportedFileType",
|
|
FileReaderReadFailed = "FileReaderReadFailed",
|
|
NotAvailableXMLHttpRequest = "NotAvailableXMLHttpRequest",
|
|
InvalidProgressEventTarget = "InvalidProgressEventTarget",
|
|
RequestError = "RequestError"
|
|
}
|
|
export declare class QiniuError implements Error {
|
|
name: QiniuErrorName;
|
|
message: string;
|
|
stack: string | undefined;
|
|
constructor(name: QiniuErrorName, message: string);
|
|
}
|
|
export declare class QiniuRequestError extends QiniuError {
|
|
code: number;
|
|
reqId: string;
|
|
/**
|
|
* @description 标记当前的 error 类型是一个 QiniuRequestError
|
|
* @deprecated 下一个大版本将会移除,不推荐使用,推荐直接使用 instanceof 进行判断
|
|
*/
|
|
isRequestError: boolean;
|
|
/**
|
|
* @description 发生错误时服务端返回的错误信息,如果返回不是一个合法的 json、则该字段为 undefined
|
|
*/
|
|
data?: any;
|
|
constructor(code: number, reqId: string, message: string, data?: any);
|
|
}
|
|
/**
|
|
* @description 由于跨域、证书错误、断网、host 解析失败、系统拦截等原因导致的错误
|
|
*/
|
|
export declare class QiniuNetworkError extends QiniuRequestError {
|
|
constructor(message: string, reqId?: string);
|
|
}
|