Skip to content

Commit

Permalink
fix bin/startup_time.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre authored and staticfloat committed Oct 11, 2023
1 parent 3f540e3 commit bc5e987
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/startup_time.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ try
end
catch e
if (isa(e, Base.IOError) && e.code == -Base.Libc.ECONNREFUSED) ||
(isa(e, HTTP.IOExtras.IOError) && e.e.code == -Base.Libc.ECONNREFUSED)
# TODO: Use ExceptionUnwrapping.jl documented API...
(isa(e, HTTP.ConnectError) && e.error.ex.code == -Base.Libc.ECONNREFUSED)
else
@warn(e, typeof(e))
end
Expand All @@ -34,4 +35,5 @@ try
end
finally
kill(p)
wait(p)
end
1 change: 1 addition & 0 deletions test/tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function handle_http_error(e)

# If it's a connection error, return the specific code, usually `ECONNREFUSED` or `EPIPE`
if isa(e, HTTP.ConnectError)
# TODO: Use ExceptionUnwrapping.jl documented API...
return e.error.ex.code
end

Expand Down

0 comments on commit bc5e987

Please sign in to comment.