RE: error handling

2002-06-17 Thread Ruane, Conleth
Don't know about UNIX but on Windows it seems that the return code is always 0.

Regards
Con

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED]
Sent: Monday, June 17, 2002 08:23
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: error handling


You're right. The command line wrapper can and probably should delete
the target file in case of an error. Could you check if the return code
is set on the command line? If not, we should fix that.

   It is. The problem is that FOP can't delete the output file
  in case of a
   problem if it only gets an OutputStream. And for
  optimization reasons
   FOP can't wait until the end to write the output to the
  target stream.
 
  But does fop should delete output file? I don't think so, that's
  responsibility of enclosing application, which has full control of
  OutputStream and can easily do this being catching FOPException.
 
 All very well for embeddding, but the command prompt version still leaves
 the corrupt file there  no file at all would be preferable to a useless
 one.
 I hope the UNIX script sets the return code on errors (haven't tested yet).

Cheers,
Jeremias Märki



error handling

2002-06-14 Thread Ruane, Conleth
I'm using the latest version of FOP to automatically generate pdf files from 
xml (what else) and I've noticed that when fop stops due to errors in the input 
file(s) a corrupt pdf file is generated.
Is there any way I can prevent this or is there any way I can access a FOP exit 
 code so that I know that something went wrong.
Currently my only option is to grep the output for errors and react on that.

Any suggestions welcome.

Thanks

Con