function showError(error) {
    errorDetectedSet(true);
    // if error has been shown return
    if (error === prevErrorMessage) return;

    // Clear previous timeout if exists
    if (fadeTimeOut) {
        clearTimeout(fadeTimeOut);
    }
    $('.alert.alert-danger').fadeOut(() => {
        $(this).remove();
    });
    prevErrorMessage = error;
    var id = Math.floor(Math.random() * 10000);
    $('#MessageDiv').append(`<div class='alert alert-danger' role='alert' id='${id}'> ${error}</div>`);
    fadeTimeOut = setTimeout(() => {
        prevErrorMessage = undefined;
        $(`#${id}`).fadeOut();
    }, 1500);
}
Helper function to show error
@param {string} error -The error to be shown
@category utils