2023-07-06 00:36:26 +02:00
|
|
|
export class RequestCanceledError extends Error {
|
2023-07-17 00:32:32 +02:00
|
|
|
public isCancel: boolean;
|
2023-07-06 00:36:26 +02:00
|
|
|
|
2023-07-17 00:32:32 +02:00
|
|
|
constructor(msg: string) {
|
|
|
|
super(msg);
|
|
|
|
this.isCancel = true;
|
|
|
|
Object.setPrototypeOf(this, RequestCanceledError);
|
|
|
|
}
|
2023-07-06 00:36:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export const isCancel = (value: any): boolean => {
|
2023-07-17 00:32:32 +02:00
|
|
|
return value && value.isCancel;
|
|
|
|
};
|