Check if errors codes are digits before int() cast