Open cd-work opened 2 years ago
Turns out since the error is passed through the JS boundary, the original error obviously can't be accessed with get_custom_error_class
anymore.
I feel like the most reasonable solution would likely be to set this error during startup in some way? This might not be the only deno CLI specific error though, so I'm not sure if a wider-reaching solution is necessary.
When using
deno_runtime
and callingexecute_main_module
, the function will return an error if it is lacking permissions to access external IO, when printing this error it will look something like this:The issue with this is that the
--allow-write
flag is specific to Deno's CLI and thus might confuse users whendeno_runtime
is embedded in another application.I've tried to work around this by using
get_custom_error_class
and checking if it isSome("PermissionDenied")
, which it should be according to the source code. However this always returnsNone
, despite the error being created throughcustom_error
, so I'm not sure that function is working properly?