Class: Grape::Middleware::Error::Options
- Inherits:
-
Data
- Object
- Data
- Grape::Middleware::Error::Options
- Defined in:
- lib/grape/middleware/error.rb
Instance Attribute Summary collapse
-
#all_rescue_handler ⇒ Object
readonly
Returns the value of attribute all_rescue_handler.
-
#base_only_rescue_handlers ⇒ Object
readonly
Returns the value of attribute base_only_rescue_handlers.
-
#content_types ⇒ Object
readonly
Returns the value of attribute content_types.
-
#default_error_formatter ⇒ Object
readonly
Returns the value of attribute default_error_formatter.
-
#default_message ⇒ Object
readonly
Returns the value of attribute default_message.
-
#default_status ⇒ Object
readonly
Returns the value of attribute default_status.
-
#error_formatters ⇒ Object
readonly
Returns the value of attribute error_formatters.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#grape_exceptions_rescue_handler ⇒ Object
readonly
Returns the value of attribute grape_exceptions_rescue_handler.
-
#internal_grape_exceptions_rescue_handler ⇒ Object
readonly
Returns the value of attribute internal_grape_exceptions_rescue_handler.
-
#rescue_all ⇒ Object
readonly
Returns the value of attribute rescue_all.
-
#rescue_grape_exceptions ⇒ Object
readonly
Returns the value of attribute rescue_grape_exceptions.
-
#rescue_handlers ⇒ Object
readonly
Returns the value of attribute rescue_handlers.
-
#rescue_options ⇒ Object
readonly
Returns the value of attribute rescue_options.
Instance Method Summary collapse
Constructor Details
#initialize(all_rescue_handler: nil, base_only_rescue_handlers: nil, content_types: nil, default_error_formatter: nil, default_message: '', default_status: 500, error_formatters: nil, format: :txt, grape_exceptions_rescue_handler: nil, internal_grape_exceptions_rescue_handler: nil, rescue_all: false, rescue_grape_exceptions: false, rescue_handlers: nil, rescue_options: nil) ⇒ Options
Returns a new instance of Options.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/grape/middleware/error.rb', line 16 def initialize( all_rescue_handler: nil, base_only_rescue_handlers: nil, content_types: nil, default_error_formatter: nil, default_message: '', default_status: 500, error_formatters: nil, format: :txt, grape_exceptions_rescue_handler: nil, internal_grape_exceptions_rescue_handler: nil, rescue_all: false, rescue_grape_exceptions: false, rescue_handlers: nil, rescue_options: nil ) # `rescue_options:` and `default_error_formatter:` arrive nil from # `Endpoint#error_middleware_options` when the API called no # `rescue_from` and no `format` — and an explicit nil bypasses the # keyword defaults above, so restore them here rather than letting nil # propagate to `def_delegator :rescue_options, :backtrace` or to the # formatter lookup in `#format_message`. super( rescue_options: || Grape::DSL::RescueOptions.new, default_error_formatter: default_error_formatter || Grape::ErrorFormatter::Txt, all_rescue_handler:, base_only_rescue_handlers:, content_types:, default_message:, default_status:, error_formatters:, format:, grape_exceptions_rescue_handler:, internal_grape_exceptions_rescue_handler:, rescue_all:, rescue_grape_exceptions:, rescue_handlers: ) end |
Instance Attribute Details
#all_rescue_handler ⇒ Object (readonly)
Returns the value of attribute all_rescue_handler
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def all_rescue_handler @all_rescue_handler end |
#base_only_rescue_handlers ⇒ Object (readonly)
Returns the value of attribute base_only_rescue_handlers
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def base_only_rescue_handlers @base_only_rescue_handlers end |
#content_types ⇒ Object (readonly)
Returns the value of attribute content_types
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def content_types @content_types end |
#default_error_formatter ⇒ Object (readonly)
Returns the value of attribute default_error_formatter
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def default_error_formatter @default_error_formatter end |
#default_message ⇒ Object (readonly)
Returns the value of attribute default_message
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def @default_message end |
#default_status ⇒ Object (readonly)
Returns the value of attribute default_status
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def default_status @default_status end |
#error_formatters ⇒ Object (readonly)
Returns the value of attribute error_formatters
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def error_formatters @error_formatters end |
#format ⇒ Object (readonly)
Returns the value of attribute format
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def format @format end |
#grape_exceptions_rescue_handler ⇒ Object (readonly)
Returns the value of attribute grape_exceptions_rescue_handler
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def grape_exceptions_rescue_handler @grape_exceptions_rescue_handler end |
#internal_grape_exceptions_rescue_handler ⇒ Object (readonly)
Returns the value of attribute internal_grape_exceptions_rescue_handler
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def internal_grape_exceptions_rescue_handler @internal_grape_exceptions_rescue_handler end |
#rescue_all ⇒ Object (readonly)
Returns the value of attribute rescue_all
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def rescue_all @rescue_all end |
#rescue_grape_exceptions ⇒ Object (readonly)
Returns the value of attribute rescue_grape_exceptions
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def rescue_grape_exceptions @rescue_grape_exceptions end |
#rescue_handlers ⇒ Object (readonly)
Returns the value of attribute rescue_handlers
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def rescue_handlers @rescue_handlers end |
#rescue_options ⇒ Object (readonly)
Returns the value of attribute rescue_options
9 10 11 |
# File 'lib/grape/middleware/error.rb', line 9 def @rescue_options end |