Exception: Mondrian::OLAP::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/mondrian/olap/error.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(native_error) ⇒ Error

Returns a new instance of Error.



11
12
13
14
15
16
# File 'lib/mondrian/olap/error.rb', line 11

def initialize(native_error)
  @native_error = native_error
  get_root_cause
  super(native_error.message)
  add_root_cause_to_backtrace
end

Instance Attribute Details

#native_errorObject (readonly)

root_cause will be nil if there is no cause for wrapped native error root_cause_message will have either root_cause message or wrapped native error message



9
10
11
# File 'lib/mondrian/olap/error.rb', line 9

def native_error
  @native_error
end

#root_causeObject (readonly)

root_cause will be nil if there is no cause for wrapped native error root_cause_message will have either root_cause message or wrapped native error message



9
10
11
# File 'lib/mondrian/olap/error.rb', line 9

def root_cause
  @root_cause
end

#root_cause_messageObject (readonly)

root_cause will be nil if there is no cause for wrapped native error root_cause_message will have either root_cause message or wrapped native error message



9
10
11
# File 'lib/mondrian/olap/error.rb', line 9

def root_cause_message
  @root_cause_message
end

Class Method Details

.wrap_native_exceptionObject



18
19
20
21
22
23
24
25
26
# File 'lib/mondrian/olap/error.rb', line 18

def self.wrap_native_exception
  yield
rescue NativeException => e
  if e.message =~ NATIVE_ERROR_REGEXP
    raise Mondrian::OLAP::Error.new(e)
  else
    raise
  end
end