@@ -193,8 +193,10 @@ function shutdown(fn::Function)
193193 try
194194 fn ()
195195 catch
196- msg = current_exceptions_to_string ()
197- @error " shutdown function $fn failed. $msg "
196+ @error begin
197+ msg = current_exceptions_to_string ()
198+ " shutdown function $fn failed. $msg "
199+ end
198200 end
199201end
200202
@@ -393,8 +395,10 @@ function listenloop(f, listener, conns, tcpisvalid,
393395 if e isa Base. IOError && e. code == Base. UV_ECONNABORTED
394396 verbose >= 0 && @infov 1 " Server on $(listener. hostname) :$(listener. hostport) closing"
395397 else
396- msg = current_exceptions_to_string ()
397- @errorv 2 " Server on $(listener. hostname) :$(listener. hostport) errored. $msg "
398+ @errorv 2 begin
399+ msg = current_exceptions_to_string ()
400+ " Server on $(listener. hostname) :$(listener. hostport) errored. $msg "
401+ end
398402 # quick little sleep in case there's a temporary
399403 # local error accepting and this might help avoid quickly re-erroring
400404 sleep (0.05 + rand () * 0.05 )
@@ -433,8 +437,10 @@ function handle_connection(f, c::Connection, listener, readtimeout, access_log)
433437 if e isa ParseError
434438 write (c, Response (e. code == :HEADER_SIZE_EXCEEDS_LIMIT ? 431 : 400 , string (e. code)))
435439 end
436- msg = current_exceptions_to_string ()
437- @debugv 1 " handle_connection startread error. $msg "
440+ @debugv 1 begin
441+ msg = current_exceptions_to_string ()
442+ " handle_connection startread error. $msg "
443+ end
438444 break
439445 end
440446
@@ -461,8 +467,10 @@ function handle_connection(f, c::Connection, listener, readtimeout, access_log)
461467 # The remote can close the stream whenever it wants to, but there's nothing
462468 # anyone can do about it on this side. No reason to log an error in that case.
463469 level = e isa Base. IOError && ! isopen (c) ? Logging. Debug : Logging. Error
464- msg = current_exceptions_to_string ()
465- @logmsgv 1 level " handle_connection handler error. $msg "
470+ @logmsgv 1 level begin
471+ msg = current_exceptions_to_string ()
472+ " handle_connection handler error. $msg "
473+ end
466474
467475 if isopen (http) && ! iswritable (http)
468476 request. response. status = 500
@@ -478,8 +486,10 @@ function handle_connection(f, c::Connection, listener, readtimeout, access_log)
478486 end
479487 catch
480488 # we should be catching everything inside the while loop, but just in case
481- msg = current_exceptions_to_string ()
482- @errorv 1 " error while handling connection. $msg "
489+ @errorv 1 begin
490+ msg = current_exceptions_to_string ()
491+ " error while handling connection. $msg "
492+ end
483493 finally
484494 if readtimeout > 0
485495 wait_for_timeout[] = false
0 commit comments