Exception: BetterTranslate::Error Abstract

Inherits:
StandardError
  • Object
show all
Defined in:
lib/better_translate/errors.rb

Overview

This class is abstract.

Base error class for all BetterTranslate errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, context: {}) ⇒ Error

Initialize a new error with optional context

Parameters:

  • message (String) (defaults to: nil)

    The error message

  • context (Hash) (defaults to: {})

    Additional context information



15
16
17
18
# File 'lib/better_translate/errors.rb', line 15

def initialize(message = nil, context: {})
  @context = context
  super(message)
end

Instance Attribute Details

#contextHash (readonly)

Returns Additional context about the error.

Returns:

  • (Hash)

    Additional context about the error



9
10
11
# File 'lib/better_translate/errors.rb', line 9

def context
  @context
end