Code coverage report for app/components/_common/services/error.service.js

Statements: 100% (28 / 28)      Branches: 100% (12 / 12)      Functions: 100% (7 / 7)      Lines: 100% (3 / 3)      Ignored: 2 statements, 4 branches     

All files » app/components/_common/services/ » error.service.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                       
// all error messages
const ERROR_MESSAGE = {
    // unexpected
    $UNEXPECTED: 'Server issue, please try later!',
    // login
    LOGIN_WRONG_EMAIL_PASSWORD_PAIR: 'Incorrect email or password, please try again!',
    LOGIN_USER_IN_LOCK: 'Your account is locked!',
    // phone
    PHONE_QUERY_NOT_FOUND: 'Sorry, the phone you queryed can not be found!',
    PHONE_UPDATE_NOT_FOUND: 'Sorry, the phone you updated can not be found!',
    PHONE_DELETE_NOT_FOUND: 'Sorry, the phone you deleted can not be found!'
};
 
class ErrorService {
    getErrorMessage (errorCode) {
        return ERROR_MESSAGE[errorCode] || ERROR_MESSAGE.$UNEXPECTED;
    }
}
 
export default ErrorService;