1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-10 08:09:06 -05:00

fix(cli/dts): Type Deno.errors.* as subclasses of Error (#10702)

This commit is contained in:
Liam Murphy 2021-07-27 04:40:24 +10:00 committed by GitHub
parent 2e69d2135a
commit 091a26104b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,27 +66,62 @@ declare interface PerformanceMeasureOptions {
declare namespace Deno { declare namespace Deno {
/** A set of error constructors that are raised by Deno APIs. */ /** A set of error constructors that are raised by Deno APIs. */
export const errors: { export namespace errors {
NotFound: ErrorConstructor; export class NotFound extends Error {
PermissionDenied: ErrorConstructor; name: "NotFound";
ConnectionRefused: ErrorConstructor; }
ConnectionReset: ErrorConstructor; export class PermissionDenied extends Error {
ConnectionAborted: ErrorConstructor; name: "PermissionDenied";
NotConnected: ErrorConstructor; }
AddrInUse: ErrorConstructor; export class ConnectionRefused extends Error {
AddrNotAvailable: ErrorConstructor; name: "ConnectionRefused";
BrokenPipe: ErrorConstructor; }
AlreadyExists: ErrorConstructor; export class ConnectionReset extends Error {
InvalidData: ErrorConstructor; name: "ConnectionReset";
TimedOut: ErrorConstructor; }
Interrupted: ErrorConstructor; export class ConnectionAborted extends Error {
WriteZero: ErrorConstructor; name: "ConnectionAborted";
UnexpectedEof: ErrorConstructor; }
BadResource: ErrorConstructor; export class NotConnected extends Error {
Http: ErrorConstructor; name: "NotConnected";
Busy: ErrorConstructor; }
NotSupported: ErrorConstructor; export class AddrInUse extends Error {
}; name: "AddrInUse";
}
export class AddrNotAvailable extends Error {
name: "AddrNotAvailable";
}
export class BrokenPipe extends Error {
name: "BrokenPipe";
}
export class AlreadyExists extends Error {
name: "AlreadyExists";
}
export class InvalidData extends Error {
name: "InvalidData";
}
export class TimedOut extends Error {
name: "TimedOut";
}
export class Interrupted extends Error {
name: "Interrupted";
}
export class WriteZero extends Error {
name: "WriteZero";
}
export class UnexpectedEof extends Error {
name: "UnexpectedEof";
}
export class BadResource extends Error {
name: "BadResource";
}
export class Http extends Error {
name: "Http";
}
export class Busy extends Error {
name: "Busy";
}
}
/** The current process id of the runtime. */ /** The current process id of the runtime. */
export const pid: number; export const pid: number;