Adds message fields to custom exceptions.