File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 1
1
import collections
2
2
import importlib
3
3
import importlib .util
4
+ import inspect
4
5
import os
5
6
import pathlib
6
7
import sys
7
8
import textwrap
8
- import traceback
9
9
from typing import Union
10
10
11
11
import click
@@ -199,20 +199,26 @@ def group(ctx):
199
199
200
200
try :
201
201
group ()
202
- except Exception :
203
- click .secho ("\n " + traceback .format_exc (limit = - 3 ), fg = "red" , file = sys .stderr )
202
+ except Exception as e :
204
203
click .secho (
205
204
textwrap .dedent (
206
205
f"""\
207
- An internal error has occurred. Please file a bug report at
208
206
209
- https://github.com/scientific-python/spin
207
+ { type ( e ). __name__ } : { e }
210
208
211
- including the above traceback and the following information :
209
+ This exception was raised from :
212
210
213
- spin: { __version__ } , package: { proj_name }
211
+ { inspect . trace ()[ - 1 ]. filename }
214
212
215
- Aborting."""
213
+ If you suspect this is a bug in `spin`, please file a report at:
214
+
215
+ https://github.com/scientific-python/spin
216
+
217
+ including the above traceback and the following information:
218
+
219
+ spin: { __version__ } , package: { proj_name }
220
+
221
+ Aborting."""
216
222
),
217
223
fg = "red" ,
218
224
bold = True ,
You can’t perform that action at this time.
0 commit comments