code: def extract_error(checker, *a, **kw):
      
  
      res = catch_error(checker, *a, **kw)
      if isinstance(res, DataError):
          return res.as_dict()
      return res
docs: Helper for tests - catch error and return it as dict