This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 06/06/2011 08:45 AM, Charles Turner wrote:On 06/06/2011 15:28, Jamison Hope wrote:<Warning: off-topic>
I would argue that the print at line 4 should say something like "#<promise - force threw a java.lang.Exception>" instead. How about the attached update to your patch?
Certainly a better error message, but I have a concern. Back when I was
fixing up some error messages, I noticed an aweful lot of ad-hoc errors
being directly written to an output buffer, just like this patch. It
seems to me that all errors should be encapsulated by a common error
class. This would mean the messages would be consistent and less
confusing. It would also be easier to extend such error classes to
things like the Swing REPL or WebSocket REPL's, etc to do more
interesting formatting. It's going to be a chore going through and
abstracting such messages, but I think it would be worthwhile.
We may gnu.text.SourceError, as well as the interface javafx.tools.Diagnostic.
Though perhaps some new class may be needed, but let's call it Diagnostic.
I could see that say the Swing REPL can special-case "printing" a Diagnostic,
like it already does for Viewable and Paintable objects. A Diagnostic would
embed an object is the output. The object might by default look like the
result of toString, but it could also (for example) allow clicking for more information.
The source information might be an active hyperlink. And so on.
Still, the devil is in the details ...
-- Jamison Hope The PTR Group www.theptrgroup.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |