On unexpected exception, return a proper error

Which contains a UUID that can be used to find the exception in the
logs.