Exception: Mondrian::OLAP::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Mondrian::OLAP::Error
- Defined in:
- lib/mondrian/olap/error.rb
Instance Attribute Summary collapse
-
#native_error ⇒ Object
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.
-
#profiling_handler ⇒ Object
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.
-
#root_cause ⇒ Object
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.
-
#root_cause_message ⇒ Object
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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(native_error, options = {}) ⇒ Error
constructor
A new instance of Error.
- #profiling_plan ⇒ Object
- #profiling_timing ⇒ Object
- #profiling_timing_string ⇒ Object
Constructor Details
#initialize(native_error, options = {}) ⇒ Error
Returns a new instance of Error.
11 12 13 14 15 16 17 |
# File 'lib/mondrian/olap/error.rb', line 11 def initialize(native_error, = {}) @native_error = native_error get_root_cause super(native_error.toString) add_root_cause_to_backtrace get_profiling() end |
Instance Attribute Details
#native_error ⇒ Object (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 |
#profiling_handler ⇒ Object (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 profiling_handler @profiling_handler end |
#root_cause ⇒ Object (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_message ⇒ Object (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 end |
Class Method Details
.wrap_native_exception(options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mondrian/olap/error.rb', line 19 def self.wrap_native_exception( = {}) yield # TokenMgrError for some unknown reason extends java.lang.Error which normally should not be rescued rescue Java::JavaLang::Exception, Java::MondrianParser::TokenMgrError => e if e.toString =~ NATIVE_ERROR_REGEXP raise Mondrian::OLAP::Error.new(e, ) else raise end end |
Instance Method Details
#profiling_plan ⇒ Object
30 31 32 33 34 |
# File 'lib/mondrian/olap/error.rb', line 30 def profiling_plan if profiling_handler && (plan = profiling_handler.plan) plan.gsub("\r\n", "\n") end end |
#profiling_timing ⇒ Object
36 37 38 |
# File 'lib/mondrian/olap/error.rb', line 36 def profiling_timing profiling_handler.timing if profiling_handler end |
#profiling_timing_string ⇒ Object
40 41 42 43 44 |
# File 'lib/mondrian/olap/error.rb', line 40 def profiling_timing_string if profiling_timing && (timing_string = profiling_timing.toString) timing_string.gsub("\r\n", "\n").sub(Mondrian::OLAP::Result::QUERY_TIMING_CUMULATIVE_REGEXP, '') end end |