Check that message is present before trying to include it in the exception