Custom error messages

I can print error messages in case something turns up that I don't expect using assert(!error)

But that doesn't allow me to cout elaborate error message. Can anyone guide me to a good way to achieve such a thing?
Topic archived. No new replies allowed.