summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-02-12 23:14:33 +0100
committerGitHub <noreply@github.com>2023-02-12 23:14:33 +0100
commit8b5be962f5dad64da1363052a3fcd4432cc08a71 (patch)
treef9c072829f8bce9eb0f1aa55b20c154154eca984 /runtime/js
parentdc66fdc11e86ae060e43dbeb417738c1b1995fe6 (diff)
fix: add WouldBlock error (#17339)
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/01_errors.js8
-rw-r--r--runtime/js/99_main.js1
2 files changed, 9 insertions, 0 deletions
diff --git a/runtime/js/01_errors.js b/runtime/js/01_errors.js
index 7e2ad29ab..8288e3ce9 100644
--- a/runtime/js/01_errors.js
+++ b/runtime/js/01_errors.js
@@ -96,6 +96,13 @@ class WriteZero extends Error {
}
}
+class WouldBlock extends Error {
+ constructor(msg) {
+ super(msg);
+ this.name = "WouldBlock";
+ }
+}
+
class UnexpectedEof extends Error {
constructor(msg) {
super(msg);
@@ -139,6 +146,7 @@ const errors = {
TimedOut,
Interrupted,
WriteZero,
+ WouldBlock,
UnexpectedEof,
BadResource,
Http,
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index fd7b93e24..a4301ed3a 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -265,6 +265,7 @@ function registerErrors() {
core.registerErrorClass("InvalidData", errors.InvalidData);
core.registerErrorClass("TimedOut", errors.TimedOut);
core.registerErrorClass("Interrupted", errors.Interrupted);
+ core.registerErrorClass("WouldBlock", errors.WouldBlock);
core.registerErrorClass("WriteZero", errors.WriteZero);
core.registerErrorClass("UnexpectedEof", errors.UnexpectedEof);
core.registerErrorClass("BadResource", errors.BadResource);