feat: add more Deno.errors classes (#19514)

This commit adds following new error classes:
- `Deno.errors.NotADirectory`
- `Deno.errors.FilesystemLoop`
- `Deno.errors.IsADirectory`
- `Deno.errors.NetworkUnreachable`

Closes https://github.com/denoland/deno/issues/19408
This commit is contained in:
Bartek Iwańczuk 2023-06-29 01:46:16 +02:00 committed by GitHub
parent 673cdd7149
commit 0434e04177
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 1 deletions

View file

@ -131,6 +131,34 @@ class NotSupported extends Error {
}
}
class FilesystemLoop extends Error {
constructor(msg) {
super(msg);
this.name = "FilesystemLoop";
}
}
class IsADirectory extends Error {
constructor(msg) {
super(msg);
this.name = "IsADirectory";
}
}
class NetworkUnreachable extends Error {
constructor(msg) {
super(msg);
this.name = "NetworkUnreachable";
}
}
class NotADirectory extends Error {
constructor(msg) {
super(msg);
this.name = "NotADirectory";
}
}
const errors = {
NotFound,
PermissionDenied,
@ -152,6 +180,10 @@ const errors = {
Http,
Busy,
NotSupported,
FilesystemLoop,
IsADirectory,
NetworkUnreachable,
NotADirectory,
};
export { errors };