def subclass_exception(name, parents, module):
  """
  A helper function that creates new instances of exceptions that can
  be used together with models.
  """
  return type(name, parents, { "__module__" : module })