Skip to content

Commit 6332ce6

Browse files
committed
fix: better error messages
1 parent e4e402d commit 6332ce6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tasks.py

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import scripts.patchup
77
from invoke import task
88

9+
# Set up a custom exception handler to print errors to stderr
10+
sys.excepthook = (lambda extype,value,trace:
11+
print(f"Error: {value}", file=sys.stderr))
12+
913
# Get all input files matching a given pattern and iterate
1014
# over them. For each input file, yield the input and output
1115
# file paths.
@@ -25,6 +29,7 @@ def fileset(input_pattern, output_pattern, forceUpdate=False, createDirs=True):
2529
os.makedirs(os.path.dirname(output), exist_ok=True)
2630
yield (input, output)
2731

32+
# Display and run the command
2833
def run(cmd):
2934
print(cmd)
3035
os.system(cmd)

0 commit comments

Comments
 (0)