[cairo] Surface error not set when using cairo_show_text() with invalid utf8
cairouser at yahoo.com
Tue Nov 2 20:54:57 PDT 2010
Maarten Bosmans wrote:
> It is the principle of failing fast. This way errors are not swept
> under the rug, but are painfully obvious. I fear that with your
> proposal bad string handling gets unnoticed by the developer, leading
> to more faulty applications.
> Failing fast gives the developer an opportunity to fix the problem. I
> mean, we're talking about programmers here, not end users. They can
> handle a line or two in the source code when your proposed behaviour
> is preferred.
But with current behavior programmer (me) doesn't get a chance to fix
the error! First of all it is not even set correctly (that's a *bug* and
it needs to be fixed) - so as a programmer I don't even get notified of
an error. The only way I see that there was an error is because my cairo
image is half-empty!
Then, even if I am notified of an error - there is nothing I can do
other than discarding the entire image and starting rendering from the
beginning with absolutely no guarantee that it will work better the
second time around. If there was a way to acknowledge the problem, say
"drop the last text output operation and continue" - sure, your approach
would be fine. But as it stands, that's just not acceptable.
More information about the cairo