Module: ConvenientService::Service::Plugins::CanHaveHandledExceptions::Concern Private

Includes:
ConvenientService::Support::Concern
Defined in:
lib/convenient_service/service/plugins/can_have_handled_exceptions/concern.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Instance Method Summary collapse

Methods included from ConvenientService::Support::Concern

included

Instance Method Details

#error_from_exception(exception, max_backtrace_size: Plugins::CanHaveFormattedExceptions.default_max_backtrace_size) ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result

Parameters:

  • max_backtrace_size (Integer) (defaults to: Plugins::CanHaveFormattedExceptions.default_max_backtrace_size)

Returns:

Since:

  • 1.0.0



21
22
23
24
25
26
27
28
# File 'lib/convenient_service/service/plugins/can_have_handled_exceptions/concern.rb', line 21

def error_from_exception(exception, max_backtrace_size: Plugins::CanHaveFormattedExceptions.default_max_backtrace_size)
  error(
    data: {handled_exception: exception},
    message: Plugins::CanHaveFormattedExceptions.format_exception(exception, max_backtrace_size: max_backtrace_size),
    code: :handled_exception
  )
    .copy(overrides: {kwargs: {exceptions: {handled: exception}}})
end