alliander-opensource / diva-irma-js

SDK for easy integration of IRMA into projects
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

Errors do not contain all the information #29

Closed stevenvegt closed 6 years ago

stevenvegt commented 6 years ago

When performing a malformed request to the IRMA server, it usaually returns a helpfull error message in the response body like:

      { error: 'ATTRIBUTES_WRONG',
        status: 400,
        description:
         'Specified attribute(s) do not belong to this credential type or missing attributes',
        stacktrace: ...
       }

diva-irma-js ignores the body reducing the information to something like Bad Request:

new Error(`Error starting IRMA session: ${error.message}`);

Which maked debugging and error handling a bit harder than it should be.

timenolthof commented 6 years ago

Agreed, this should be fixed. We are working on a 2.0.0 release of diva. @koen92 can you check that we fixed this in 2.0.0?

timenolthof commented 6 years ago

This has been resolved in 2.0.0 by adding a 'DEBUG' loglevel, see the troubleshooting section in the new documentation for help on how to use this: https://github.com/Alliander/diva-irma-js#troubleshooting