Exception: Rho::RhoError
Constant Summary collapse
- ERR_NONE =
0
- ERR_NETWORK =
1
- ERR_REMOTESERVER =
2
- ERR_RUNTIME =
3
- ERR_UNEXPECTEDSERVERRESPONSE =
4
- ERR_DIFFDOMAINSINSYNCSRC =
5
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(err_code) ⇒ RhoError
constructor
A new instance of RhoError.
- #message ⇒ Object
Constructor Details
#initialize(err_code) ⇒ RhoError
Returns a new instance of RhoError.
12 13 14 |
# File 'lib/rho/rhoerror.rb', line 12 def initialize(err_code) @code = err_code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/rho/rhoerror.rb', line 10 def code @code end |
Instance Method Details
#message ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rho/rhoerror.rb', line 16 def if code == ERR_NETWORK return "Could not establish network connection" elsif code == ERR_REMOTESERVER return "Server returned an error" elsif code == ERR_RUNTIME return "Internal error" elsif code == ERR_UNEXPECTEDSERVERRESPONSE return "Unexpected server response" elsif code == ERR_DIFFDOMAINSINSYNCSRC return "All sync sources should be from one domain" end return "Unknown error" end |