Skip to content

Commit

Permalink
#1035 new error descriptions for LWA (fix for scan parse) + font adju…
Browse files Browse the repository at this point in the history
…stment
  • Loading branch information
adiganga2002 committed Nov 15, 2022
1 parent d46717d commit b319f21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apihub-root/lightweight-pwa/js/controllers/ScanController.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,16 @@ function ScanController() {
let gs1Fields = null;
try {
gs1Fields = this.parseGS1Code(scanResultText);
goToPage(`/leaflet.html?gtin=${gs1Fields.gtin}&batch=${gs1Fields.batchNumber}&expiry=${gs1Fields.expiry}`)
goToPage(`/leaflet.html?gtin=${gs1Fields.gtin}&batch=${gs1Fields.batchNumber}&expiry=${gs1Fields.expiry}`);
} catch (err) {
if (err.message) {
if (err.message.includes("INVALID CHECK DIGIT:")) {
goToErrorPage(constants.errorCodes.gtin_wrong_digit);
return;
}
if (err.message.includes("SYNTAX ERROR:")) {
goToErrorPage(constants.errorCodes.gtin_wrong_chars);
return;
}
}
goToErrorPage(constants.errorCodes.unknown_error);
Expand Down

0 comments on commit b319f21

Please # to comment.