In the following portion of code I make sure that, when the server returns an error message, the client shows it on the screen and, consequently, does not perform the operat