Class: StunClient::RFC3489Message::ErrorCode
- Inherits:
-
BinData::Record
- Object
- BinData::Record
- StunClient::RFC3489Message::ErrorCode
- Defined in:
- lib/stun-client/rfc3489/message.rb
Overview
Represents the content of the attribute ‘ERROR-CODE’. This contains an error code like HTTP and an error message.
Constant Summary collapse
- ERROR_MESSAGES =
Hash, which contains the error messages for the error class and the error number.
{ 4 => { 0 => 'Bad request', 1 => 'Unauthorized', 20 => 'Unknown Attribute', 30 => 'Stale Credentials', 31 => 'Integrity Check Failure', 32 => 'Missing Username', 33 => 'Use TLS' }.freeze, 5 => { 0 => 'Server Error' }.freeze, 6 => { 0 => 'Global Failure:' }.freeze }.freeze
Instance Method Summary collapse
-
#get_error_message(error_class, error_number) ⇒ String
Returns an error message for an error code.
Instance Method Details
#get_error_message(error_class, error_number) ⇒ String
Returns an error message for an error code.
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/stun-client/rfc3489/message.rb', line 76 def error_class, error_number if ERROR_MESSAGES.has_key? error_class if ERROR_MESSAGES[error_class].has_key? error_number return ERROR_MESSAGES[error_class][error_number] end return 'Unknown error number' end return 'Unknown error class' end |