MCPcopy
hub / github.com/treeverse/dvc / wrapper

Function wrapper

dvc/utils/__init__.py:385–396  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

383
384def error_handler(func):
385 def wrapper(*args, **kwargs):
386 onerror = kwargs.get("onerror")
387 result = {}
388
389 try:
390 vals = func(*args, **kwargs)
391 if vals:
392 result["data"] = vals
393 except Exception as e: # noqa: BLE001
394 if onerror is not None:
395 onerror(result, e, **kwargs)
396 return result
397
398 return wrapper
399

Callers

nothing calls this directly

Calls 3

funcFunction · 0.50
onerrorFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected