1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-26 21:35:57 +00:00

Add identifiers to error messages

To ease the debug process
This commit is contained in:
Robin Stuart
2016-10-28 22:40:40 +01:00
parent 5405035df1
commit 4561a66067
35 changed files with 296 additions and 298 deletions

View File

@@ -271,12 +271,12 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
error_number = 0;
if (length > 32) {
strcpy(symbol->errtxt, "Input too long");
strcpy(symbol->errtxt, "Input too long (D50)");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(SODIUM, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data");
strcpy(symbol->errtxt, "Invalid characters in data (D51)");
return error_number;
}
@@ -311,11 +311,11 @@ int imail(struct zint_symbol *symbol, unsigned char source[], int length) {
}
if (strlen(tracker) != 20) {
strcpy(symbol->errtxt, "Invalid length tracking code");
strcpy(symbol->errtxt, "Invalid length tracking code (D52)");
return ZINT_ERROR_INVALID_DATA;
}
if (strlen(zip) > 11) {
strcpy(symbol->errtxt, "Invalid ZIP code");
strcpy(symbol->errtxt, "Invalid ZIP code (D53)");
return ZINT_ERROR_INVALID_DATA;
}