richardhundt / luv

libuv bindings for Lua
Apache License 2.0
118 stars 19 forks source link

normalize errors #9

Open dvv opened 11 years ago

dvv commented 11 years ago

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

richardhundt commented 11 years ago

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.