(*args, **kwargs)
| 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 |