server/repository.py
branchstable
changeset 9184 b982e88e4836
parent 9171 be9596750678
child 9226 653f1d4a1101
equal deleted inserted replaced
9183:95e69c2d52a9 9184:b982e88e4836
   791                 # NOTE: the web front will (re)build it when needed
   791                 # NOTE: the web front will (re)build it when needed
   792                 #       e.g in facets
   792                 #       e.g in facets
   793                 #       Zeroed to avoid useless overhead with pyro
   793                 #       Zeroed to avoid useless overhead with pyro
   794                 rset._rqlst = None
   794                 rset._rqlst = None
   795                 return rset
   795                 return rset
   796             except (Unauthorized, RQLSyntaxError):
   796             except (ValidationError, Unauthorized, RQLSyntaxError):
   797                 raise
       
   798             except ValidationError as ex:
       
   799                 # need ValidationError normalization here so error may pass
       
   800                 # through pyro
       
   801                 if hasattr(ex.entity, 'eid'):
       
   802                     ex.entity = ex.entity.eid # error raised by yams
       
   803                     args = list(ex.args)
       
   804                     args[0] = ex.entity
       
   805                     ex.args = tuple(args)
       
   806                 raise
   797                 raise
   807             except Exception:
   798             except Exception:
   808                 # FIXME: check error to catch internal errors
   799                 # FIXME: check error to catch internal errors
   809                 self.exception('unexpected error while executing %s with %s', rqlstring, args)
   800                 self.exception('unexpected error while executing %s with %s', rqlstring, args)
   810                 raise
   801                 raise