[entity] rather than crashing with an IndexError on entity creation, raise a meaningful exception
--- a/entity.py Wed Nov 12 22:18:55 2014 +0100
+++ b/entity.py Thu Nov 13 15:48:33 2014 +0100
@@ -519,7 +519,11 @@
rql = 'INSERT %s X: %s' % (cls.__regid__, rql)
else:
rql = 'INSERT %s X' % (cls.__regid__)
- created = execute(rql, qargs).get_entity(0, 0)
+ try:
+ created = execute(rql, qargs).get_entity(0, 0)
+ except IndexError:
+ raise Exception('could not create a %r with %r (%r)' %
+ (cls.__regid__, rql, qargs))
created._cw_update_attr_cache(attrcache)
cls._cw_handle_pending_relations(created.eid, pendingrels, execute)
return created