Better error handling with sweetAlert popups.