update ts samples

This commit is contained in:
William Cheng 2022-09-06 23:28:51 +08:00
parent 86d6511449
commit a91201d4ed

View File

@ -234,21 +234,21 @@ function isFormData(value: any): value is FormData {
} }
export class ResponseError extends Error { export class ResponseError extends Error {
name: "ResponseError" = "ResponseError"; override name: "ResponseError" = "ResponseError";
constructor(public response: Response, msg?: string) { constructor(public response: Response, msg?: string) {
super(msg); super(msg);
} }
} }
export class FetchError extends Error { export class FetchError extends Error {
name: "FetchError" = "FetchError"; override name: "FetchError" = "FetchError";
constructor(public cause: Error, msg?: string) { constructor(public cause: Error, msg?: string) {
super(msg); super(msg);
} }
} }
export class RequiredError extends Error { export class RequiredError extends Error {
name: "RequiredError" = "RequiredError"; override name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) { constructor(public field: string, msg?: string) {
super(msg); super(msg);
} }