Class: Startback::Web::Shield

Inherits:
Rack::Robustness
  • Object
show all
Includes:
Errors
Defined in:
lib/startback/web/shield.rb

Overview

This Rack middleware catches all known exceptions raised by sublayers in the Rack chain. Those exceptions are converted to proper HTTP error codes and friendly error messages encoded in json.

Please check the Errors module about status codes used for each Startback error.

This class aims at being used as top level of a Rack chain.

Examples:

Rack::Builder.new do
  use Startback::Web::Shield
end

Method Summary

Methods included from Errors

bad_request_error!, conflict_error!, expectation_failed_error!, forbidden_error!, gone_error!, internal_server_error!, locked_error!, method_not_allowed_error!, not_acceptable_error!, not_found_error!, not_implemented_error!, precondition_failed_error!, precondition_required_error!, server_error!, unauthorized_error!, unsupported_media_type_error!, user_error!