dominikh / go-augeas

Go bindings for augeas
MIT License
21 stars 7 forks source link

Return "generic" error if a function returns an error state but does … #14

Open hillu opened 7 years ago

hillu commented 7 years ago

…not set error_code

Close #13

The underlying problem is documented in https://github.com/hercules-team/augeas/issues/464

dominikh commented 7 years ago

Are you sure that this change doesn't break other functions? We do only call error when ret is -1 or less than 0 (depending on the function), but I don't remember if any function returns a negative value while not having encountered an error.

hillu commented 7 years ago

I am not quite sure about New(). Other than that, the error() method is only called in actual error paths, i.e. if the corresponding Augeas C API function has returned an error value (usually -1 or otherwise negative).