The mysqli_error_list() function returns a list of errors for the most recent function call, if any.
mysqli_error_list(connection);