jschyma / open_fints_js_client

FinTS/HBCI Javascript Client
Apache License 2.0
132 stars 44 forks source link

String literals should be replaced with real errors #33

Open tndev opened 7 years ago

tndev commented 7 years ago

In FinTSClient.js and maybe also other places a string is passed as error to the callback instead of a real Error object.

For example:

FinTSClient.js:638:

cb(e.toString(), null, false)

FinTSClient.js:650:

cb('Keine Initialisierung Erfolgreich Nachricht erhalten!', recvMsg, false)

But you should always pass real Error to the error parameter (or as reject to a Promise).

Is there a reason why you choose a string instead of an Error?

I would suggest to change these to real Errors.