We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73b75c6 commit b1fc2beCopy full SHA for b1fc2be
1 file changed
spin/__main__.py
@@ -3,6 +3,8 @@
3
import importlib.util
4
import os
5
import sys
6
+import textwrap
7
+import traceback
8
9
import click
10
@@ -152,8 +154,25 @@ def group(ctx):
152
154
153
155
try:
156
group()
- except Exception as e:
- print(f"Error: {e}; aborting.", file=sys.stderr)
157
+ except Exception:
158
+ click.secho("\n" + traceback.format_exc(limit=-3), fg="red", file=sys.stderr)
159
+ click.secho(
160
+ textwrap.dedent(
161
+ f"""\
162
+ An internal error has occurred. Please file a bug report at
163
+
164
+ https://github.com/scientific-python/spin
165
166
+ including the above traceback and the following information:
167
168
+ spin: {__version__}, package: {proj_name}
169
170
+ Aborting."""
171
+ ),
172
+ fg="red",
173
+ bold=True,
174
+ file=sys.stderr,
175
+ )
176
sys.exit(1)
177
178
0 commit comments