Check that error message is not for an assertion.

This commit checks that the error message is not just an assertion.
Otherwise, the returned error message is a carbon copy of the regular
message and no new information is given to the user.