Fix exceptions output when creating object in DB

Fixes: bug #1268501

Change-Id: I0fe7f61b72afc9cd7a5c3b65b343c1d438e07632