Groups 193 of 99+ julia-users › Capturing Error messages as strings 3 posts by 2 authors Matthew Pearce Mar 30 Anyone know how to capture error messages as strings? This is for debugging of code run on remote machines, as the trace on the master node appears to be incomplete. Note I am not asking about the atexit behaviour. I am asking about capturing non-fatal errors like sqrt -1 rather than segfaults etc. Much appreciated Matthew Matthew Pearce Apr 4 Anyone? At the moment it is very hard to debug parallel work. With issues like 14456 and related problems, it would be extraordinarily helpful to have access to the full error messages from remotes. I care enough about this to actually try writing code implementing any hints suggestions people might have. Isaiah Apr 6 Re: julia-users Re: Capturing Error messages as strings If you can manage wrap your remote code in `try` blocks, maybe the following example will help. I've had to use things like this for remote debugging in the past : ``` julia addprocs 4 4-element Array Int64,1 : 2 3 4 5 julia everywhere E Any julia everywhere try error foo catch err push! E, string err, on , myid , \n\n , stacktrace end julia fetch spawnat 3 global E; E 1 ErrorException \ foo\ on 3\n\n in eval ::Module, ::Any at boot-jl:237, inlined code from sysimg-jl:11\n in ::Base.Serializer.__deserialized_types__. 261 at multi-jl:1502, in run_work_thunk ::Base. 252 254 Base.CallMsg :call_fetch , ::Bool at multi-jl:744, inlined code from multi-jl:1038\n in ::Base. 251 253 Base.CallMsg :call_fetch ,TCPSocket at event-jl:46 ```