From: Jochen V. <vo...@se...> - 2004-11-18 11:57:35
|
Hello, On Wed, Nov 17, 2004 at 10:54:49AM -0700, Fernando Perez wrote: > Bad design. Doing exception analysis based on string matching for the=20 > message is very brittle. A single change in capitalization of the messag= e=20 > can break things down the road. Sorry, maybe I was not clear enough. What I tried to suggest was: 1) GUI backends should catch the SystemExit exception from the PS backend, thus being able to continue running even if the backend aborts with an error. 2) GUI backends should in case that they caught a SystemExit exception notify the user that saving the figure as PostScript failed. If the exception is associated with an error message string, they could display this string to the user. > 1. have the ps/svg backends do whatever cleanup they want, and then rerai= se=20 > the original exception unchanged >=20 > 2. or simply make a matplotlib.SaveError exception which can be explicitl= y=20 > caught based on class matching, which is the preferred python way of doin= g=20 > this. Maybe. But how is any information except "the backend failed with error message ..." useful to the GUI? Would it act differently on an font-not-found condition then it would on a save-failed one? All the best, Jochen --=20 http://seehuhn.de/ |