MCPcopy
hub / github.com/freedomofpress/dangerzone / wrapper

Function wrapper

dangerzone/errors.py:109–118  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

107
108 @functools.wraps(func)
109 def wrapper(*args, **kwargs): # type: ignore
110 try:
111 return func(*args, **kwargs)
112 except DocumentFilenameException as e:
113 if getattr(sys, "dangerzone_dev", False):
114 # Show the full traceback only on dev environments.
115 msg = "An exception occured while validating a document"
116 log.exception(msg)
117 click.echo(str(e))
118 sys.exit(1)
119
120 return cast(F, wrapper)
121

Callers

nothing calls this directly

Calls 1

exitMethod · 0.80

Tested by

no test coverage detected