Closing the dialog if the server return an error message.