From 18d495c7d17cf3fce3835e732094d058f51eddaa Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 15 Aug 2018 23:36:48 -0400 Subject: Better error handling in src/handlers.rs Introduces error codes that are shared between JS/RS Fixes #526. --- src/msg.fbs | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'src/msg.fbs') 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; } -- cgit v1.2.3