Closed sogaiu closed 2 months ago
Note that now that #160 has been addressed, with the changes in #170 applied, the paths in the error output are more "fleshed out".
For example, they show up here as:
/home/user/.local/lib/janet/no-spork.jimage
/home/user/.local/lib/janet/no-spork.janet
/home/user/.local/lib/janet/no-spork/init.janet
/home/user/.local/lib/janet/no-spork.so
instead of:
/not-spork.jimage
/not-spork.janet
/not-spork/init.janet
/not-spork.so
because locally:
$ janet
Janet 1.33.0-23b0fe9f linux/x64/gcc - '(doc)' for help
repl:1:> (dyn :syspath)
"/home/user/.local/lib/janet"
The call to coerce-to-env in netrepl's server function can fail because the env argument to coerce-to-env is invoked if it is a function.
janet-netrepl
specifies a function value forenv
in a couple of places and that function can fail because it can call require and/or dofile with values specified by a user at the command line.In the case of a failure-triggering invocation via
janet-netrepl
, the client connection is closed after establishment and there is no error feedback regarding the failure provided on the server end.The following is a demonstration of the described situation (similar to that in #160).
Suppose spork is installed (so
janet-netrepl
is available).Start server, requesting non-installed / unavailable library:
Start client (note the exiting apparent from the second prompt):
Observe output for server:
With the following diff:
Server output looks like:
That seems a bit better.
Note that the values:
start with
/
with no "intermediate" path because of #160. (The values might change if #160 is addressed, but I don't think that is significant for this issue.)