@@ -193,8 +193,10 @@ function shutdown(fn::Function)
193
193
try
194
194
fn ()
195
195
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
198
200
end
199
201
end
200
202
@@ -393,8 +395,10 @@ function listenloop(f, listener, conns, tcpisvalid,
393
395
if e isa Base. IOError && e. code == Base. UV_ECONNABORTED
394
396
verbose >= 0 && @infov 1 " Server on $(listener. hostname) :$(listener. hostport) closing"
395
397
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
398
402
# quick little sleep in case there's a temporary
399
403
# local error accepting and this might help avoid quickly re-erroring
400
404
sleep (0.05 + rand () * 0.05 )
@@ -433,8 +437,10 @@ function handle_connection(f, c::Connection, listener, readtimeout, access_log)
433
437
if e isa ParseError
434
438
write (c, Response (e. code == :HEADER_SIZE_EXCEEDS_LIMIT ? 431 : 400 , string (e. code)))
435
439
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
438
444
break
439
445
end
440
446
@@ -461,8 +467,10 @@ function handle_connection(f, c::Connection, listener, readtimeout, access_log)
461
467
# The remote can close the stream whenever it wants to, but there's nothing
462
468
# anyone can do about it on this side. No reason to log an error in that case.
463
469
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
466
474
467
475
if isopen (http) && ! iswritable (http)
468
476
request. response. status = 500
@@ -478,8 +486,10 @@ function handle_connection(f, c::Connection, listener, readtimeout, access_log)
478
486
end
479
487
catch
480
488
# 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
483
493
finally
484
494
if readtimeout > 0
485
495
wait_for_timeout[] = false
0 commit comments