Skip to content

SMS Delivery Failure with Error Code 0 and 'Unknown error' Message #1

Open
@Anatras02

Description

Overview

I am encountering a consistent issue with SMS delivery where the error returned is { code: 0, message: 'Unknown error' }. This error is not providing enough information to diagnose the problem, and it occurs when I try to send an SMS through the smsgate library.

Environment

  • Node.js version: 20.9.0
  • smsgate version: 1.0.1
  • Operating System: Ubuntu 22.04

Steps to Reproduce

  1. Create an express JS endpoint with an endpoint like that
app.post('/send-sms-email', (req, res) => {
    let gate = new SMSGate.Client('http://sms.horisen.info:12020', '/bulk/sendsms');
    gate.send({
        "type": "text",
        "auth": { "username": process.env.HORISEN_USER, "password": process.env.HORISEN_PASS },
        "sender": "BulkTest",
        "receiver": req.body.numero,
        "dcs": SMSGate.text,
        "text": req.body.messaggio
    }).then(response => {
        console.log("SMS sent", response);
        res.end("SMS sent" + JSON.stringify(response));

    }).catch(error => {
        console.log("SMS error", error);
        res.end("SMS error" + JSON.stringify(error));
    });
})
  1. Do a call with curl or postman

Expected Behavior

The SMS should be sent successfully, or an error with a clear and actionable message should be returned.

Actual Behavior

When attempting to send an SMS, the operation fails and the error { code: 0, message: 'Unknown error' } is returned with no further details.

Additional Information

  • The error occurs every time an SMS is attempted to be sent.
  • There have been no changes in the codebase that would affect SMS delivery.
  • With my colleague node modules folder it works but when I run npm install or npm ci it not longer works

Thank you for your assistance.

Alessio

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions