summaryrefslogtreecommitdiff
path: root/src/msg.fbs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-08-15 23:36:48 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-08-21 15:37:45 -0400
commit18d495c7d17cf3fce3835e732094d058f51eddaa (patch)
treef7244cfd83dbff9d8aaf67203feb0f3a24fe95f3 /src/msg.fbs
parentcb1393cdaea4bfbee69efbf7ce86a4adfc4593b3 (diff)
Better error handling in src/handlers.rs
Introduces error codes that are shared between JS/RS Fixes #526.
Diffstat (limited to 'src/msg.fbs')
-rw-r--r--src/msg.fbs41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/msg.fbs b/src/msg.fbs
index 89ecfec45..d1629ba69 100644
--- a/src/msg.fbs
+++ b/src/msg.fbs
@@ -1,6 +1,6 @@
namespace deno;
-union Any {
+union Any {
Start,
StartRes,
CodeFetch,
@@ -17,8 +17,47 @@ union Any {
WriteFileSync,
}
+enum ErrorKind: byte {
+ NoError = 0,
+
+ // io errors
+
+ NotFound,
+ PermissionDenied,
+ ConnectionRefused,
+ ConnectionReset,
+ ConnectionAborted,
+ NotConnected,
+ AddrInUse,
+ AddrNotAvailable,
+ BrokenPipe,
+ AlreadyExists,
+ WouldBlock,
+ InvalidInput,
+ InvalidData,
+ TimedOut,
+ Interrupted,
+ WriteZero,
+ Other,
+ UnexpectedEof,
+
+ // url errors
+
+ EmptyHost,
+ IdnaError,
+ InvalidPort,
+ InvalidIpv4Address,
+ InvalidIpv6Address,
+ InvalidDomainCharacter,
+ RelativeUrlWithoutBase,
+ RelativeUrlWithCannotBeABaseBase,
+ SetHostOnCannotBeABaseUrl,
+ Overflow,
+}
+
table Base {
cmd_id: uint32;
+ error_kind: ErrorKind = NoError;
error: string;
msg: Any;
}