Skip to content

Commit 20bcb38

Browse files
committed
[cli] print traceback fully if the verbose flag is passed
1 parent 0d75b9d commit 20bcb38

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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.
@@ -197,5 +198,8 @@ except netjsonconfig.exceptions.ValidationError as e:
197198
print(message + info)
198199
sys.exit(4)
199200
except TypeError as e:
201+
if args.verbose:
202+
traceback.print_exc()
203+
200204
print('netjsonconfig: {0}'.format(e))
201205
sys.exit(5)

0 commit comments

Comments
 (0)