UNPKG

827 BTypeScriptView Raw
1import { AmplifyErrorParams } from '@aws-amplify/core/internals/utils';
2import { StorageError } from './StorageError';
3/**
4 * Internal-only class for CanceledError thrown by XHR handler or multipart upload when cancellation is invoked
5 * without overwriting behavior.
6 *
7 * @internal
8 */
9export declare class CanceledError extends StorageError {
10 constructor(params?: Partial<AmplifyErrorParams>);
11}
12/**
13 * Check if an error is caused by user calling `cancel()` on a upload/download task. If an overwriting error is
14 * supplied to `task.cancel(errorOverwrite)`, this function will return `false`.
15 * @param {unknown} error The unknown exception to be checked.
16 * @returns - A boolean indicating if the error was from an upload cancellation
17 */
18export declare const isCancelError: (error: unknown) => error is CanceledError;