Near line 1000: switch (obj.code) { obj.code is a number but the case values are strings ("32000" and "410") - so they will never match as comparison in a switch is strict (aka ===). The fix is to remove the quotes round the numbers.