summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/01_errors.js10
-rw-r--r--runtime/js/99_main.js1
2 files changed, 10 insertions, 1 deletions
diff --git a/runtime/js/01_errors.js b/runtime/js/01_errors.js
index bfcb540e2..ea567a5d0 100644
--- a/runtime/js/01_errors.js
+++ b/runtime/js/01_errors.js
@@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { core, primordials } from "ext:core/mod.js";
-const { BadResource, Interrupted, PermissionDenied } = core;
+const { BadResource, Interrupted, NotCapable } = core;
const { Error } = primordials;
class NotFound extends Error {
@@ -116,6 +116,13 @@ class Busy extends Error {
}
}
+class PermissionDenied extends Error {
+ constructor(msg) {
+ super(msg);
+ this.name = "PermissionDenied";
+ }
+}
+
class NotSupported extends Error {
constructor(msg) {
super(msg);
@@ -176,6 +183,7 @@ const errors = {
IsADirectory,
NetworkUnreachable,
NotADirectory,
+ NotCapable,
};
export { errors };
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index f81ab3d8f..4b17635bb 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -294,6 +294,7 @@ core.registerErrorClass("NotConnected", errors.NotConnected);
core.registerErrorClass("AddrInUse", errors.AddrInUse);
core.registerErrorClass("AddrNotAvailable", errors.AddrNotAvailable);
core.registerErrorClass("BrokenPipe", errors.BrokenPipe);
+core.registerErrorClass("PermissionDenied", errors.PermissionDenied);
core.registerErrorClass("AlreadyExists", errors.AlreadyExists);
core.registerErrorClass("InvalidData", errors.InvalidData);
core.registerErrorClass("TimedOut", errors.TimedOut);