Permalink
Browse files

make common error strings more descriptive

Add more descriptive error strings for common errors, namely
BCERR_INVALID_INPUT, BCERR_NO_FORMAT_FILE, and BCERR_NO_MATCHING_FORMAT.
  • Loading branch information...
1 parent 6d1c891 commit a69cd94b71d3aa315d2bb2cd0e305f3c21404adc @ossguy committed May 27, 2009
Showing with 6 additions and 3 deletions.
  1. +6 −3 bitconvert.c
View
@@ -777,19 +777,22 @@ const char* bc_strerror(int err)
case 0:
return "Success";
case BCERR_INVALID_INPUT:
- return "Invalid input";
+ return "Invalid input - input must contain only 0s or 1s; "
+ "partial results shown";
case BCERR_PARITY_MISMATCH:
return "Parity mismatch";
case BCERR_NO_FORMAT_FILE:
- return "No format file";
+ return "No formats file - make sure formats.txt is in the "
+ "current directory";
case BCERR_PCRE_COMPILE_FAILED:
return "PCRE compile failed";
case BCERR_FORMAT_MISSING_PERIOD:
return "Format missing period";
case BCERR_FORMAT_MISSING_NAME:
return "Format missing name";
case BCERR_NO_MATCHING_FORMAT:
- return "No matching format";
+ return "No matching format - to recognize the fields in this "
+ "data, add a format to formats.txt";
case BCERR_BAD_FORMAT_ENCODING_TYPE:
return "Bad format encoding type";
case BCERR_FORMAT_MISSING_RE:

0 comments on commit a69cd94

Please sign in to comment.