help-smalltalk
[Top][All Lists]
Advanced

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

[Help-smalltalk] gst from git master + iliad from svn trunk + hanging ve


From: Stefan Schmiedl
Subject: [Help-smalltalk] gst from git master + iliad from svn trunk + hanging verboseMode response
Date: Fri, 26 Jun 2009 20:25:51 +0200

= a few hours of unbridled fun and printNl debugging :-)

<bla>
So I'm running the most recent smalltalk and the most recent Iliad.
And after I actually started doing something _with_ Iliad instead of
_to_ it (what a willing victim for testing packaging Iliad is), I
notice that sometimes my browser hangs waiting for a response...
and always I manage to find a bug.

Switching the application to deploymentMode displays the expected 500
message, so it must have something to do with the default verboseMode.

Veni, vidi, and there are messages in ErrorHandler>>produceVerboseResponse
that cannot be found in the docs ... if this ain't an invitation to mess
around, I don't know what is.

Removing the "weird" stuff and sprinkling it with "self error inspect"
and "self error backtraceOn: Transcript" produces quite interesting
information ... on the console.
</bla>

So gst has inspect with hardcoded Transcript references in it.
And there are four definitions of inspect in the base classes to
accomodate different types of objects.
Well, my local gst now only has one inspect in Object but four
inspectOn: aStream in the base classes ... and things still work.

The good new is that I now can produce some really helpful debugging
info in ErrorHandler.st

     produceVerboseResponse [
        <category: 'responding'>
        |info|
        info := WriteStream on: String new.
        self error inspectOn: info.
        self error context backtraceOn: info.
        FileStream stderr nextPutAll: info contents.
        self respond: [:response || page |
                page := Page new.
                page bodyElement h1: 'Internal Error';
                    h2: self error description;
                    h3: self error messageText;
                    preformatted: info contents.
                page build printHtmlOn: response]
     ]

So now I not only see _where_ the problem occurred, I also see
with _what data_ it occurred.... sweeet.

I'm attaching the two patches to this message for your consideration.

s.

Attachment: inspectOn.patch
Description: Text Data

Attachment: ErrorHandler.patch
Description: Text Data


reply via email to

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