Exception: Net::TTI::Exceptions::ErrorMessageReceived
- Inherits:
-
TTIException
- Object
- StandardError
- TTIException
- Net::TTI::Exceptions::ErrorMessageReceived
- Defined in:
- lib/net/tti/exceptions.rb
Direct Known Subclasses
Constant Summary collapse
- ERROR_REGEX =
/ORA\-(\d+)(?:\:\ (.*))?/
- ERROR_REGEX_INDEX_CODE =
1
- ERROR_REGEX_INDEX_DESCRIPTION =
2
Instance Method Summary collapse
-
#error_code ⇒ Integer
Attempts to parse and return the “ORA-xxxxx” error code from the error message.
-
#error_description ⇒ String
Attempts to parse and return the error description after the “ORA-xxxxx” error code in the error message.
Instance Method Details
#error_code ⇒ Integer
Attempts to parse and return the “ORA-xxxxx” error code from the error message
39 40 41 42 43 44 |
# File 'lib/net/tti/exceptions.rb', line 39 def error_code() matches = ERROR_REGEX.match( self. ) error_code = matches[ERROR_REGEX_INDEX_CODE] unless( matches.nil? or matches[ERROR_REGEX_INDEX_CODE].nil? ) error_code = error_code.to_i unless error_code.nil? return error_code end |
#error_description ⇒ String
Attempts to parse and return the error description after the “ORA-xxxxx” error code in the error message
50 51 52 53 |
# File 'lib/net/tti/exceptions.rb', line 50 def error_description() matches = ERROR_REGEX.match( self. ) return matches[ERROR_REGEX_INDEX_DESCRIPTION] unless( matches.nil? or matches[ERROR_REGEX_INDEX_DESCRIPTION].nil? ) end |