You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Glen Mazza <gr...@yahoo.com> on 2004/12/27 15:55:01 UTC

Re: cvs commit: xml-fop/src/java/org/apache/fop/area AreaTreeHandler.java

Simon,

Why aren't these fatal errors--what's the gain in
having FOP continue running in an invalid state?

One-in-a-million bugs like these that occur for
inexplicable reasons should raise an
IllegalStateException and halt.  FOP should not
continue running after catastrophic failures.

Glen

--- spepping@apache.org wrote:

>   +        } catch (FOPException e) {
>   +            log.error
>   +                ("Failed to create a
> StaticContentLayoutManager for flow "
>   +                 + flow.getFlowName()
>   +                 + "; no static content will be
> laid out:");
>   +            log.error(e.getMessage());
>   +            return;
>   +        }
>            lm.initialize();
>            lm.setRegionReference(reg.getRegion());

..................

>            if (pageSequence.getMainFlow() != null) {
>   -            PageSequenceLayoutManager pageSLM =
>   -                (PageSequenceLayoutManager)
>   +            PageSequenceLayoutManager pageSLM;
>   +            try {
>   +                pageSLM =
> (PageSequenceLayoutManager)
>                   
>
getLayoutManagerMaker().makeLayoutManager(pageSequence);
>   +            } catch (FOPException e) {
>   +                log.error("Failed to create a
> PageSequenceLayoutManager; no pages will be laid
> out:");
>   +                log.error(e.getMessage());
>   +                return;
>   +            }


Re: cvs commit: xml-fop/src/java/org/apache/fop/area AreaTreeHandler.java

Posted by Glen Mazza <gr...@yahoo.com>.
--- Simon Pepping <sp...@leverkruid.nl> wrote:
<snip/>
>
> I have contained
> its effect by catching the exception, and have not
> explored the stack
> of methods that may need to declare the throwing of
> an exception. That
> is a problem in its own right, to be solved at
> another moment.
> 

OK...sorry to be rushing you.

Glen


Re: cvs commit: xml-fop/src/java/org/apache/fop/area AreaTreeHandler.java

Posted by Simon Pepping <sp...@leverkruid.nl>.
Glen,

On Mon, Dec 27, 2004 at 06:55:01AM -0800, Glen Mazza wrote:
> Simon,
> 
> Why aren't these fatal errors--what's the gain in
> having FOP continue running in an invalid state?
> 
> One-in-a-million bugs like these that occur for
> inexplicable reasons should raise an
> IllegalStateException and halt.  FOP should not
> continue running after catastrophic failures.

Mostly, because that is not the problem I am solving at the moment. I
reimplemented the LM creation system. In so doing the fact that a
single LM is not guaranteed was exposed more clearly. I have contained
its effect by catching the exception, and have not explored the stack
of methods that may need to declare the throwing of an exception. That
is a problem in its own right, to be solved at another moment.

Regards, Simon
 
> Glen
> 
> --- spepping@apache.org wrote:
> 
> >   +        } catch (FOPException e) {
> >   +            log.error
> >   +                ("Failed to create a
> > StaticContentLayoutManager for flow "
> >   +                 + flow.getFlowName()
> >   +                 + "; no static content will be
> > laid out:");
> >   +            log.error(e.getMessage());
> >   +            return;
> >   +        }
> >            lm.initialize();
> >            lm.setRegionReference(reg.getRegion());
> 
> ..................
> 
> >            if (pageSequence.getMainFlow() != null) {
> >   -            PageSequenceLayoutManager pageSLM =
> >   -                (PageSequenceLayoutManager)
> >   +            PageSequenceLayoutManager pageSLM;
> >   +            try {
> >   +                pageSLM =
> > (PageSequenceLayoutManager)
> >                   
> >
> getLayoutManagerMaker().makeLayoutManager(pageSequence);
> >   +            } catch (FOPException e) {
> >   +                log.error("Failed to create a
> > PageSequenceLayoutManager; no pages will be laid
> > out:");
> >   +                log.error(e.getMessage());
> >   +                return;
> >   +            }
> 

-- 
Simon Pepping
home page: http://www.leverkruid.nl