diff --git a/CHANGELOG.md b/CHANGELOG.md index 891ba39..86b373d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.5.6 +* add an exception logic in SICEPAT. + # 2.5.5 * fixed an issue in SICEPAT is not working. diff --git a/lib/courier/sicepat.js b/lib/courier/sicepat.js index 0a652ab..6e0d458 100644 --- a/lib/courier/sicepat.js +++ b/lib/courier/sicepat.js @@ -140,6 +140,9 @@ module.exports = function (opts) { } try { + if (body.sicepat.status.code !== 200) { + return cb(body.sicepat.status.description) + } var result = handler.parser.trace(body.sicepat.result, number) cb(result ? null : tracker.error(tracker.ERROR.INVALID_NUMBER), result) } catch (e) { diff --git a/package.json b/package.json index 782057b..aae02e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "delivery-tracker", - "version": "2.5.5", + "version": "2.5.6", "author": { "name": "egg", "email": "i@egg.pe.kr"