Js-ipfs: Error codes

Created on 8 May 2019  路  1Comment  路  Source: ipfs/js-ipfs

Since we've started using the err-code module, we can add a string code property to JS errors and assert on that in tests, etc.

I notice some people use the form ERR_OH_NOES instead of what appears to be the idiomatic (well - node/inherited from Unix) style of EOHNOES.

Was there a reason for this or did the first person to use the module just like underscores?

Also, here's a sweet bike shed though am unsure about the colour:

addition-bike-08

cc @ipfs/repos-javascript

kinquestion

Most helpful comment

I don't have strong opinions on the format for naming but we should at least try to be consistent. Node.js uses both, with ERR_ prefixed errors reserved for Node.js specific errors. I believe the majority of codes added so far are ERR_ prefixed so it would be easier to stick to it at this stage.

>All comments

I don't have strong opinions on the format for naming but we should at least try to be consistent. Node.js uses both, with ERR_ prefixed errors reserved for Node.js specific errors. I believe the majority of codes added so far are ERR_ prefixed so it would be easier to stick to it at this stage.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

valmack picture valmack  路  3Comments

daviddias picture daviddias  路  3Comments

mnts picture mnts  路  3Comments

Ntmf picture Ntmf  路  4Comments

dryajov picture dryajov  路  3Comments