File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
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
5
4
import os
6
5
import pathlib
7
6
import sys
8
7
import textwrap
8
+ import traceback
9
9
from typing import Union
10
10
11
11
import click
@@ -199,17 +199,16 @@ def group(ctx):
199
199
200
200
try :
201
201
group ()
202
- except Exception as e :
202
+ except Exception :
203
203
click .secho (
204
- textwrap .dedent (
205
- f"""\
206
-
207
- { type (e ).__name__ } : { e }
208
-
209
- This exception was raised from:
210
-
211
- { inspect .trace ()[- 1 ].filename }
204
+ "\n " + "" .join (traceback .format_exception (* sys .exc_info (), limit = - 1 )),
205
+ fg = "red" ,
206
+ bold = True ,
207
+ file = sys .stderr ,
208
+ )
212
209
210
+ click .secho (
211
+ textwrap .dedent (f"""\
213
212
If you suspect this is a bug in `spin`, please file a report at:
214
213
215
214
https://github.com/scientific-python/spin
@@ -218,9 +217,8 @@ def group(ctx):
218
217
219
218
spin: { __version__ } , package: { proj_name }
220
219
221
- Aborting."""
222
- ),
223
- fg = "red" ,
220
+ Aborting.""" ),
221
+ fg = "yellow" ,
224
222
bold = True ,
225
223
file = sys .stderr ,
226
224
)
You can’t perform that action at this time.
0 commit comments