Subject: Re: breaking the ABI (was Re: 'watch' libssh2 on github)

Re: breaking the ABI (was Re: 'watch' libssh2 on github)

From: Will Cosgrove <>
Date: Fri, 13 Mar 2015 09:18:12 -0700

> >> we have a function like errorMessageFromCode(int code), the _code_ is the code coming from any o’l libssh function call.
> >
> >
> > But that's the mistake. All libssh2 functions don't return the same error code set. The libssh2_knownhost*() functions for example only return error codes in the LIBSSH2_KNOWNHOST_CHECK_* series.
> If I may weigh in here, the known_host return codes aren't error codes at all. That's where the misunderstanding has occurred.
> Most libssh2 return codes are indeed errors. You can think of them as exceptions, in a language that has that feature. Apart from EAGAIN, you never call a libssh2 function expecting to recieve one of those errors.
> Contrast that with the known_host functions. There the return code is a result, not an error. You call those functions fully expecting to get any of the possible values returned.

I understand these are technically not errors per-say, but that doesn’t mean I agree with their values being the same.


Received on 2015-03-13