[Seaside] Write stack traces to stderr?
David Farber
dfarber at numenor.com
Sat May 2 22:51:38 UTC 2009
On May 2, 2009, at 3:41 PM, David Farber wrote:
> After nosing around a bit, it looks like I need to modify
> WAResponse class>>internalError: to see errors raised during the
> construction of a response (and write a stack trace out to a log).
> But it strikes me as odd that Seaside doesn't already have a
> facility for logging errors. Am I missing something?!
OK, I was off a bit on that one. I see now that there is a
configurable Error Handler that defaults to WAWalkbackErrorHandler.
As a quick hack, if I redefine WAWalkback>>initializeWithException:
like below, then I get what I want.
initializeWithException: anException
| context |
exception := anException.
context := anException signalerContext.
FileStream oldFileNamed: '/dev/stderr' do: [:file |
file lineEndConvention: #lr.
file wantsLineEndConversion: true.
context errorReportOn: file].
frames := OrderedCollection new.
[ context isNil ] whileFalse: [
frames add: context.
context := context sender ].
limit := 5 min: frames size
So what I need is a custom ErrorHandler that prints a simple
acknowledgment message and logs the error. I think I can handle that.
While I am here, let me switch to a Pier question real quick. How
can I generate an error page that uses the header and footer of site?
Thanks,
David
More information about the seaside
mailing list