Code Monkey home page Code Monkey logo

Comments (8)

kellyjandrews avatar kellyjandrews commented on July 28, 2024 1

Thanks for this @soullivaneuh - I will take a look at this soon and let you know what I can figure out. I'm currently working through some old issues and catching up with the status of the SDK. Thanks again!

from vonage-node-sdk.

manchuck avatar manchuck commented on July 28, 2024 1

@cbetta If you update to V3, we are throwing errors as we have migrated to using promises. This should no longer be an issue for you.

from vonage-node-sdk.

pardel avatar pardel commented on July 28, 2024 1

@cbetta better late than never ;)

from vonage-node-sdk.

cbetta avatar cbetta commented on July 28, 2024

@leggetter can we close this now, based on the 2.0 release?

from vonage-node-sdk.

leggetter avatar leggetter commented on July 28, 2024

@cbetta I thought we could assess this as part of Nexmo/nexmo-cli#123

Based on the above:

The error object in a callback, with a message attributes

If message is present on the body response it will be available via error.body.message. But not across all APIs.

The error object in a callback, with a error-code and error-code-label attribute

Available via error.body['error-code'] etc. But I'd want to check to see what happens if we get a 2xx response. It may be that we don't make a callback with an error.

The response object in a callback, with a status attribute with a value of 0

I don't think we expose the response object. We just expose the success result.

from vonage-node-sdk.

cbetta avatar cbetta commented on July 28, 2024

@leggetter ok, I will evaluate!

from vonage-node-sdk.

soullivaneuh avatar soullivaneuh commented on July 28, 2024

This one is quite crazy IMO. If I follow the TS API you made, I should implement the verify API that way:

nexmo.verify.request({
  number: phoneNumber,
  brand: 'Company',
  code_length: '4'
}, (err: VerifyError, data: RequestResponse) => {
  if (err) {
    console.log('error:', err);
    throw new Unavailable('test', err);
  }

  console.log('result:', data)
});

Here VerifyError contrains the status and the error_text fields.

But If I try this with bad credentials for example, I have the error... on the data object. 🤔

To me it's a bug as this does not respect the typescript interface.

Am I right?

from vonage-node-sdk.

cbetta avatar cbetta commented on July 28, 2024

Tnx for the update after 6 years 😂

from vonage-node-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.