Skip to content

Commit 9a18b3f

Browse files
committed
[cli] print traceback fully if the verbose flag is passed
1 parent c8e3daf commit 9a18b3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/netjsonconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import sys
55
import six
66
import argparse
77
import netjsonconfig
8+
import traceback
89

910
description = """
1011
Converts a NetJSON DeviceConfiguration object to native router configurations.
@@ -198,5 +199,8 @@ except netjsonconfig.exceptions.ValidationError as e:
198199
print(message + info)
199200
sys.exit(4)
200201
except TypeError as e:
202+
if args.verbose:
203+
traceback.print_exc()
204+
201205
print('netjsonconfig: {0}'.format(e))
202206
sys.exit(5)

0 commit comments

Comments
 (0)