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 11import collections
22import importlib
33import importlib .util
4+ import inspect
45import os
56import pathlib
67import sys
78import textwrap
8- import traceback
99from typing import Union
1010
1111import click
@@ -199,20 +199,26 @@ def group(ctx):
199199
200200 try :
201201 group ()
202- except Exception :
203- click .secho ("\n " + traceback .format_exc (limit = - 3 ), fg = "red" , file = sys .stderr )
202+ except Exception as e :
204203 click .secho (
205204 textwrap .dedent (
206205 f"""\
207- An internal error has occurred. Please file a bug report at
208206
209- https://github.com/scientific-python/spin
207+ { type ( e ). __name__ } : { e }
210208
211- including the above traceback and the following information :
209+ This exception was raised from :
212210
213- spin: { __version__ } , package: { proj_name }
211+ { inspect . trace ()[ - 1 ]. filename }
214212
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."""
216222 ),
217223 fg = "red" ,
218224 bold = True ,
You can’t perform that action at this time.
0 commit comments