Ensure that something gets added to the error response even if the
caught exception has no associated text.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
results.append(err)
except Exception as err:
log.exception("error updating resource")
- result = ErrorResult(resource, msg=str(err))
+ msg = str(err)
+ if not msg:
+ # handle the case where the exception has no text
+ msg = f"error updating resource: {type(err)} (see logs for details)"
+ result = ErrorResult(resource, msg=msg)
results.append(result)
if results.success:
log.debug(