Rails pdftk error
I'm using pdftk within my rails application to generate a composite pdf of several individual pdf files. When,开发者_如何学运维 for whatever reason, pdftk does not generate the composite file, no error is generated. I do have this area of code wrapped in a begin/rescue block, but since i'm using %x[...] to execute pdftk, it doesn't receive any exeptions from the external call. How can i either a) call pdftk where i can capture the exception or b) receive the output error code from the %x call?
`pdftk #{subcommand}`
raise Exception unless $?.success?
精彩评论