dmolina/DaemonMode.jl

Throw on failure to connect to server

Closed this issue · 2 comments

altre commented

I'm not quite sure, but wouldn't it be better to fail with an exception when not being able to connect to the server, instead of just logging:

println(stderr, "Error, cannot connect with server. Is it running?")

My current use case is a simple bash script which falls back to using Julia without the daemonmode if not installed or running. I would then need to parse the output in stderr instead of using the return value.

I have just update the code to return the code when there is a simple error (as it cannot connect to the server, or the file is not found). It is in the current master version.
I want to return also when any exception is returned for next version, but it could take more time, because I have to change the communications.

The last version is better for scripting. It returns the error code if there is an error in the case of not connection or Exception.