This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 179c090c Handle errors ourselves
179c090c is described below
commit 179c090cb0308f06b543538f16500073d5d7854e
Author: Sebb <[email protected]>
AuthorDate: Mon Jan 27 15:42:01 2025 +0000
Handle errors ourselves
---
www/secretary/workbench/server.rb | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/www/secretary/workbench/server.rb
b/www/secretary/workbench/server.rb
index f97c26c4..a94ad536 100644
--- a/www/secretary/workbench/server.rb
+++ b/www/secretary/workbench/server.rb
@@ -49,12 +49,22 @@ ASF::Mail.configure
SECS_TO_DAYS = 60*60*24
-set :show_exceptions, true
disable :logging # suppress log of requests to stderr/error.log
require 'whimsy/asf/status'
+error do
+ err = env['sinatra.error']
+ <<~EOD
+ <pre>
+ Error detected, please see web server error log for full details:
+
+ #{Time.now.gmtime.to_s}: #{err.detailed_message}
+ </pre>
+ EOD
+end
+
# list of messages
get '/' do
redirect to('/') if env['REQUEST_URI'] == env['SCRIPT_NAME']