Fix error message assertion.
Use Error objects when throwing something.