Last Update: 2018-10-12 13:18:35 -0700

New Features

  • An exception_page plugin has been added for displaying debugging information for a given exception. It is based on Rack::ShowExceptions, with the following differences:

    • Not a middleware, so it doesn’t handle exceptions itself, and has no effect on the callstack unless the exception_page method is called.

    • Supports external javascript and stylesheets, allowing context toggling to work in applications that use a content security policy to restrict inline javascript and stylesheets (:assets, :css_file, and :js_file options).

    • Has fewer dependencies (does not require ostruct and erb).

    • Sets the Content-Type for the response, and returns the body string, but does not modify other headers or the response status.

    • Supports a configurable amount of context lines in backtraces (:context option).

    • Supports optional JSON formatted output, if used with the json plugin (:json option).

    Because this plugin just adds a method you can call, you can selectively choose when to display a debugging page and when not to, as well as customize the debugging parameters on a per-call basis (such as returning JSON formatted debugging information for JSON requests, and HTML formatted debugging information for normal requests).

Other Improvements

  • The common_logger plugin now correctly handles cases where an exception is being raised and there is no rack response to introspect.

Backwards Compatibility

  • Stream#write in the streaming plugin now returns the number of bytes written instead of self, so it works with IO.copy_stream.