Skip to content

Commit e36dc2c

Browse files
committed
added exception handling to reading pcap file
1 parent ad7970f commit e36dc2c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

type.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ def printType(element):
1111

1212
def main():
1313
path = raw_input('Enter the path of the pcap file you want to read: ')
14-
a = rdpcap(path)
14+
try:
15+
a = rdpcap(path)
16+
except:
17+
print 'Error opening the pcap file'
1518
printType(a)
1619

1720
main()

0 commit comments

Comments
 (0)