got
Version:
Human-friendly and powerful HTTP request library for Node.js
18 lines (17 loc) • 433 B
JavaScript
import { RequestError } from '../core/errors.js';
/**
An error to be thrown when the request is aborted with `.cancel()`.
*/
export class CancelError extends RequestError {
constructor(request) {
super('Promise was canceled', {}, request);
this.name = 'CancelError';
this.code = 'ERR_CANCELED';
}
/**
Whether the promise is canceled.
*/
get isCanceled() {
return true;
}
}