Giter VIP home page Giter VIP logo

Comments (3)

symisc avatar symisc commented on June 26, 2024

Well, what you got when an enrollment or authentication operation fails actually is an integer error code documented here. The promise is rejected with the corresponding error code. On your error handler callback, you have to make a big switch statement to isolate the returned error code just like the following gist: https://gist.github.com/symisc/34203d2811a39f2a871373abc6dd1ce9#file-faceio_integration_boilerplate-html-L95.

Please note that there is no this.handleError(errCode) method implementation, you have to implement it yourself on your code base. Please remove that statement from your code to get it working. Check the gist above for a typical implementation of the handleError(errCode) function.

from faceio-npm.

NaturalDevCR avatar NaturalDevCR commented on June 26, 2024

Sorry but your documentation doesn't states anything about integer error codes and actually the link you provided with the gist, is exactly the same way I've implemented the switch statement to handle errors, but obviously, if whats returned is an integer, how is the switch statement gonna work if it's expecting something else?

Like where is defined fioErrCode?

image

This is not clear to me, and copying that code exactly as is, it's simply not working... please be more clear about it.

from faceio-npm.

NaturalDevCR avatar NaturalDevCR commented on June 26, 2024

Well, what you got when an enrollment or authentication operation fails actually is an integer error code documented here. The promise is rejected with the corresponding error code. On your error handler callback, you have to make a big switch statement to isolate the returned error code just like the following gist: https://gist.github.com/symisc/34203d2811a39f2a871373abc6dd1ce9#file-faceio_integration_boilerplate-html-L95.

Please note that there is no this.handleError(errCode) method implementation, you have to implement it yourself on your code base. Please remove that statement from your code to get it working. Check the gist above for a typical implementation of the handleError(errCode) function.

If what you mean is that we should asumme that the error list provided here is listed in order meaning that the first one would be the errorCode 1, the second one the errorCode 2, and so on, that it's absolutely not clear, and you should either provide a better, cleaner and understandable documentation or change these errorCodes to their respective string names as many other API usually do.

from faceio-npm.

Related Issues (11)

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.