Class jabberwerx.ErrorReporter
Extends
jabberwerx.JWBase.
This class manages user-friendly strings for error cases.
NOTE: This class should not be created directly. Use the singleton jabberwerx.errorReporter instead.
Constructor Attributes | Constructor Name and Description |
---|---|
Creates a new ErrorReporter. |
Method Attributes | Method Name and Description |
---|---|
addMessage(key, value)
Adds an entry to the error map to associate an error with user-friendly message. |
|
getMessage(err)
Returns a user-friendly string associated with the error object passed in. |
- Methods borrowed from class jabberwerx.JWBase:
- destroy, getClassName, graphUnserialized, init, invocation, shouldBeSavedWithGraph, shouldBeSerializedInline, toString, wasUnserialized, willBeSerialized
Class Detail
jabberwerx.ErrorReporter()
Creates a new ErrorReporter.
NOTE: This class should not be created directly. Use the singleton jabberwerx.errorReporter instead.
Method Detail
addMessage(key, value)
Adds an entry to the error map to associate an error with user-friendly message.
- Parameters:
- {string} key
- The string representation of the error.
- {string} value
- The user-friendly message to associate with the key.
- Throws:
- {TypeError}
- if {value} is not a string.
{string}
getMessage(err)
Returns a user-friendly string associated with the error object passed in.
- Parameters:
- {string|Element} err
- Error object.
- Returns:
- {string} Error message associated with err.