I'd like to implement better error handling and display. Comments or
suggestions for implementation simplification appreciated.
Right now, scripts either complete successfully (which the user knows
because content appears on the screen), or often just throw a 500 error
(meaning someone with permissions needs to look in /members/log). It
would be much more polite to
I'm hoping this can all be encapsulated cleanly in the future Wunderbar
extensions I'm trying to build, like in test/trademark.cgi:
class Wunderbar::HtmlMarkup
def _whimsy_header style, title
# Output logos, simple whimsy-wide code/questions/about links, etc.
end
def _whimsy_cleanup options-needed?
# Function to call at the end of a script
if error then
with body[id = 'script-error'] do
.visible
.content = $stacktrace.simplified
end
else
body[id = "script-ok"].content = "OK"
end
end
script-ok would be bootstrap badge in the end of the top navbar, which
would appear when content is added to let the user know the ruby script
has completed fully Obviously, this is most important for scripts that
just create large tables, to let the user know the entire table was
completed.
script-error would be a bootstrap alert-error block below the navbar,
and would appear with some sort of stacktrace to let the user know the
script itself caused an error, and what it was. This is far easier to
debug script errors than looking in the server logs.
I'm using this new file to test the concept, and will move to lib/asf
once it passes muster (or once someone shows me the right way to do it)
I also hope to add 500/401/404 custom error pages as static html,
presumably by updating the httpd.conf stuff here:
https://github.com/apache/infrastructure-puppet/blob/deployment/data/nodes/whimsy-vm3.apache.org.yaml#L171
--
- Shane
https://www.apache.org/foundation/marks/resources