freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] FT_Done_Face Should Not Return An Error


From: Gregor Mückl
Subject: Re: [ft] FT_Done_Face Should Not Return An Error
Date: Sun, 6 May 2018 00:11:12 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 5/5/2018 11:32 PM, Lawrence D'Oliveiro wrote:
On Sat, 5 May 2018 19:49:30 +0200, Gregor Mückl wrote:

Please don't create another library that blindly terminates its host
program on a whim.

s/whim/internal consistency failure/


Which is a whim as far as the caller is concerned, isn't it?

Returning an error really is the right thing to do
here. Just make it clear that this is a bad error.

And what exactly is the caller supposed to do about it?


Whatever the hell it pleases to do. I've outlined a few possibilities already. Depending on what the program is for, it may need to do some things even if (or especially because) things went wrong.

Just don't assume that you know better than the creator of the host program when it is okay to bail and how to do so. This is highly dependent on the actual purpose of the program - which you can't assume anything about. It could be a database frontend, a game or a medical device.

The only thing that I could possibly see myself agreeing with is a set of asserts that can be compiled in conditionally in specialized debug builds. So you'd get to break into the debugger if one of these very bad situations happen. A release build should be more optimistic and try to keep running instead, reporting the error.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]