function handleLoginApiError(response) {

    if (!response || response.status === 200)
        return;

    if (response.status === 401) {
        sweetAlert('Incorrect login details', 'These login credentials were not recognised. Please try again.', 'error');
    } else {
        var message = 'An error has occurred, please contact an administrator.';

        if (response.responseJSON) {
            message = response.responseJSON.message;
        }

        console.log(message);
        sweetAlert("Error", message, "error");
    }
}
/* Unique error handling for the login screen */
Unique error handling for the login screen
Unique error handling for the login screen
function handleLoginApiError(response) {
    if (!response || response.status === 200)
        return;
    if (response.status === 401) {
        sweetAlert('Incorrect login details', 'These login credentials were not recognised. Please try again.', 'error');
    } else {
        var message = 'An error has occurred, please contact an administrator.';
        if (response.responseJSON) {
            message = response.responseJSON.message;
        }
        console.log(message);
        sweetAlert("Error", message, "error");
    }
}
function handleLoginApiError ( response ) { if ( ! response || response . status === 200 ) return ; if ( response . status === 401 ) { sweetAlert ( 'Incorrect login details' , 'These login credentials were not recognised. Please try again.' , 'error' ) ; } else { var message = 'An error has occurred, please contact an administrator.' ; if ( response . responseJSON ) { message = response . responseJSON . message ; } console . log ( message ) ; sweetAlert ( "Error" , message , "error" ) ; } }
Unique error handling for the login screen
Unique error handling for the login screen