aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-21 09:41:52 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-21 09:41:52 +0000
commit6cbf6ce16c45c4855ebddd3516465885e3c476d5 (patch)
tree299ce4fc08cb26cc0c0712c6b54de9c76893e7ca /rawshark.c
parent0315e063e4267b97fc7716301350af07dd0f2bea (diff)
Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code. Have it also supply a err_info string, and report it. Have file_error() supply an err_info string. Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to suggest a decompression error - into the rawshark and tshark errors, along the lines of what other programs print. Fix a case in the Netscaler code where we weren't fetching the error code on a read failure. svn path=/trunk/; revision=36748
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/rawshark.c b/rawshark.c
index d1e08b98cf..4481a41f55 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -990,27 +990,32 @@ load_cap_file(capture_file *cf)
switch (err) {
case WTAP_ERR_UNSUPPORTED_ENCAP:
- cmdarg_err("\"%s\" has a packet with a network type that Rawshark doesn't support.\n(%s)",
+ cmdarg_err("The file \"%s\" has a packet with a network type that Rawshark doesn't support.\n(%s)",
cf->filename, err_info);
break;
case WTAP_ERR_CANT_READ:
- cmdarg_err("An attempt to read from \"%s\" failed for some unknown reason.",
+ cmdarg_err("An attempt to read from the file \"%s\" failed for some unknown reason.",
cf->filename);
break;
case WTAP_ERR_SHORT_READ:
- cmdarg_err("\"%s\" appears to have been cut short in the middle of a packet.",
+ cmdarg_err("The file \"%s\" appears to have been cut short in the middle of a packet.",
cf->filename);
break;
case WTAP_ERR_BAD_RECORD:
- cmdarg_err("\"%s\" appears to be damaged or corrupt.\n(%s)",
+ cmdarg_err("The file \"%s\" appears to be damaged or corrupt.\n(%s)",
+ cf->filename, err_info);
+ break;
+
+ case WTAP_ERR_DECOMPRESS:
+ cmdarg_err("The compressed file \"%s\" appears to be damaged or corrupt.\n(%s)",
cf->filename, err_info);
break;
default:
- cmdarg_err("An error occurred while reading \"%s\": %s.",
+ cmdarg_err("An error occurred while reading the file \"%s\": %s.",
cf->filename, wtap_strerror(err));
break;
}