Re: [AD] 4.3 error handling redux |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2006-07-28, Chris <chris.kcat@xxxxxxxxxx> wrote:
> On Wednesday 26 July 2006 00:09, Peter Wang wrote:
> > Does this mean that if I don't want to use any fancy callbacks, I call
> > al_error_set_handler(AL_ERROR_IGNORE) at the start of the program and
> > check every function call with al_error()?
>
> Yup. Could even be made to be a flag in al_init if you wanted. Though if you
> wanted to check every function with al_error, you could first check the
> function's return value, and if that indicates failure, then use al_error
> (since the variables are TLS you may not want to go checking it all the time
> if you don't need to).
Ok, good. I thought you weren't using the return values for error
reporting any more.
> > I would have two versions of al_get_error(): one that returns a code
> > only, and one that returns the string also.
>
> What would you call the other function? Somehow I don't think al_get_error_ext
> would fly very well after 4.2's *_ex function flood, and al_get_error_str
> sounds a bit ambiguous since it'll return the error code too.
I don't think that's too bad. al_get_error_message() ?
Peter