cubicweb #2793789 unique together errors not properly reported in the ui [validation pending]

There is a faulty regex in source/native.py that assumes an '_idx' postfix on the IntegrityError base message. It may be absent because of a truncation issue. See "see also" ticket.

see:

2013-04-05 11:16:18 - (cubicweb.web) ERROR: unexpected error while validating form
Traceback (most recent call last):
 File "/home/auc/confs/simulagora/cubicweb/web/views/basecontrollers.py", line 214, in _validate_form
   ctrl.publish(None)
 File "/home/auc/confs/simulagora/cubicweb/web/views/editcontroller.py", line 120, in publish
   self._default_publish()
 File "/home/auc/confs/simulagora/cubicweb/web/views/editcontroller.py", line 138, in _default_publish
   eid = self.edit_entity(formparams)
 File "/home/auc/confs/simulagora/cubicweb/web/views/editcontroller.py", line 214, in edit_entity
   entity.eid = self._insert_entity(etype, formparams['eid'], rqlquery)
 File "/home/auc/confs/simulagora/cubicweb/web/views/editcontroller.py", line 164, in _insert_entity
   entity = self._cw.execute(rql, rqlquery.kwargs).get_entity(0, 0)
 File "/home/auc/confs/simulagora/cubicweb/dbapi.py", line 520, in execute
   build_descr=build_descr, **self._txid())
 File "/home/auc/confs/simulagora/cubicweb/server/repository.py", line 780, in execute
   build_descr)
 File "/home/auc/confs/simulagora/cubicweb/server/querier.py", line 738, in execute
   results = plan.execute()
 File "/home/auc/confs/simulagora/cubicweb/server/querier.py", line 204, in execute
   result = step.execute()
 File "/home/auc/confs/simulagora/cubicweb/server/ssplanner.py", line 505, in execute
   result = self.plan.insert_entity_defs()
 File "/home/auc/confs/simulagora/cubicweb/server/querier.py", line 555, in insert_entity_defs
   for edef in row])
 File "/home/auc/confs/simulagora/cubicweb/server/repository.py", line 1359, in glob_add_entity
   source.add_entity(session, entity)
 File "/home/auc/confs/simulagora/cubicweb/server/sources/native.py", line 634, in add_entity
   self.doexec(session, sql, attrs)
 File "/home/auc/confs/simulagora/cubicweb/server/sources/native.py", line 739, in doexec
   cursor.execute(str(query), args)
IntegrityError: duplicate key value violates unique constraint "unique_cw_versionedscript_cw_code_revision_cw_entry_file_path_c"
prioritynormal
typebug
done in3.17.3
load0.100
load left0.000
closed by#0f1504a9fb51 [constraint] more robust unicity constraint failures reporting for end-users
patchsource/native, entities/adapters: more robust unicity constraint failures reporting for end-users (closes #2793789) [applied]