lib/exceptions/backends/rollbar.rb
# if reporting via the `error_class` and `error_message` args, we need to
# trick the rollbar reporter into thinking it's an actual exception. by
# doing that, rollbar will report the error class and message correctly,
# and show a stack trace, which it doesn't do when passing it a string.
if reporting via the `error_class` and `error_message` args, we need to
trick the rollbar reporter into thinking it's an actual exception. by
doing that, rollbar will report the error class and message correctly,
and show a stack trace, which it doesn't do when passing it a string.
if reporting via the ` error_class ` and ` error_message ` args we need to trick the rollbar reporter into thinking it ' s an actual exception . by doing that rollbar will report the error class and message correctly and show a stack trace which it doesn ' t do when passing it a string .
def maybe_turn_into_exception(error_class_or_exception_or_string,
                                    error_message)
        if error_class_or_exception_or_string.is_a?(Exception)
          error_class_or_exception_or_string
        else
          PlaceholderError.new(
            class_name: error_class_or_exception_or_string.to_s,
            error_message: error_message.to_s)
        end
      end
def maybe_turn_into_exception ( error_class_or_exception_or_string , error_message ) if error_class_or_exception_or_string . is_a? ( Exception ) error_class_or_exception_or_string else PlaceholderError . new ( class_name : error_class_or_exception_or_string . to_s , error_message : error_message . to_s ) end end
if reporting via the `error_class` and `error_message` args, we need to
trick the rollbar reporter into thinking it's an actual exception.
if reporting via the ` error_class ` and ` error_message ` args we need to trick the rollbar reporter into thinking it ' s an actual exception .
error_class_or_exception_or_string
<not_specific>
error_message
<not_specific>