Should we try just returning the top one, and we can change it later if
need by, it's a private API after all.


On Sat, Mar 1, 2014 at 1:00 PM, Paul Kehrer <notifications@github.com>wrote:

> In cryptography/hazmat/backends/openssl/backend.py:
>
> > -                    )
> > -
> > -        raise InternalError(
> > +    def _consume_errors(self):
> > +        errors = []
> > +        while 1:
> > +            code = self._lib.ERR_get_error()
> > +            if code == 0:
> > +                break
> > +
> > +            lib = self._lib.ERR_GET_LIB(code)
> > +            func = self._lib.ERR_GET_FUNC(code)
> > +            reason = self._lib.ERR_GET_REASON(code)
> > +
> > +            errors.append((code, lib, func, reason))
> > +        return errors
>
> ...interesting question. I'm not sure. We certainly can't guarantee that a
> given function will only raise one error but arguably we could just return
> the first error (which is presumably the most relevant one) since
> subsequent errors are likely to be related to the first anyway.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/707/files#r10192468>
> .
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084