def __init__(self, error_def, **error_args):
    if isinstance(error_def, ErrorDef):
      self.id = error_def.id
      message = error_def.format % error_args
    else:
      assert isinstance(error_def, basestring)
      assert not error_args
      self.id = None
      message = error_def

    super(ViewfinderError, self).__init__(message)
dataset/ETHPy150Open viewfinderco/viewfinder/backend/base/exceptions.py/ViewfinderError.__init__/original