luv icon indicating copy to clipboard operation
luv copied to clipboard

normalize errors

Open dvv opened this issue 11 years ago • 1 comments

Hi!

Please, consider normalizing returned errors. Examples of inconsistency:

https://github.com/richardhundt/luv/blob/master/src/luv_stream.c#L62 https://github.com/richardhundt/luv/blob/master/src/luv_stream.c#L114 https://github.com/richardhundt/luv/blob/master/src/luv_stream.c#L132

etc.

IMHO it's the best to return stringified error code ("ENOMEM", "EEXIST" etc). The rationale is: to not introduce incompatibility between platforms (as E* integers may vary); to not introduce errors enumerations; to not decide for user on error format.

TIA, --Vladimir

dvv avatar Oct 09 '12 12:10 dvv

Yeah, needs doing. Stringified error codes is a good idea. I'll give it a shot.

On Oct 9, 2012, at 2:42 PM, Vladimir Dronnikov wrote:

Hi!

Please, consider normalizing returned errors. Examples of inconsistency:

https://github.com/richardhundt/luv/blob/master/src/luv_stream.c#L62 https://github.com/richardhundt/luv/blob/master/src/luv_stream.c#L114 https://github.com/richardhundt/luv/blob/master/src/luv_stream.c#L132

etc.

IMHO it's the best to return stringified error code ("ENOMEM", "EEXIST" etc). The rationale is: to not introduce incompatibility between platforms (as E* integers may vary); to not introduce errors enumerations; to not decide for user on error format.

TIA, --Vladimir

— Reply to this email directly or view it on GitHub.

richardhundt avatar Oct 09 '12 13:10 richardhundt