Tuesday, February 07, 2006

This is how exceptions are handled

This is how WcmController.java, the "Controller" part of FileNet Workplace's implementation of MVC pattern, handles exceptions:

First, declare this:

private Exception configureWindowIdException = null;


Then, in ConfigurePage function, do this:

public void configurePage(ServletContext applicationValue, HttpServletRequest request, long windowIdMode)
throws Exception
{
... skipped ...
configureWindowId(request);

// If configureWindowId constructed an exception, throw it.
if ( configureWindowIdException != null )
{
if ( !sp.isSignedIn() )
{
// We attempted to propogate a window Id when not signed in
// probably the result of signing out of an info page.
// Don't throw. Fix the windowId to mainWindow instead.
//
WindowID assignedId = new WindowID(null);
WindowID currentId = new WindowID(null);

assignWindowId(assignedId, currentId, false);
configureWindowState();
postProcessWindowId(assignedId, currentId, currentId,
false, false, false, false, false);
}
else
throw configureWindowIdException;
}
... skipped ...
}
What about good old try-catch?

There is no proper exception handling in Workplace. Should I send this piece to The Daily WTF?

Technorati Tags: ,

0 Comments:

Post a Comment

<< Home