farhadi / node-smpp

SMPP client and server implementation in node.js
MIT License
417 stars 177 forks source link

Command status codes related to official SMPP Spec Error Codes #234

Closed elhananjair closed 7 months ago

elhananjair commented 1 year ago

Hello there, I just read about handling errors on this package like this:

session.on('error', function(e) {
    // empty callback to catch emitted errors to prevent exit due unhandled errors
    if (e.code === "ETIMEOUT") {
        // TIMEOUT
    } else if (e.code === "ECONNREFUSED" {
        // CONNECTION REFUSED
    } else {
        // OTHER ERROR
    }
});

isn't it better to map error codes to make it similar to the one with SMPP Spec? the one used on the above code is obscure relating to the spec, and does all SMPP Error codes implemented on this library? Thanks. reference: https://smpp.org/smpp-error-codes.html