exportSession must be closed _before_ it throws.

This commit is contained in:
Colin Kuskie 2009-04-17 19:04:55 +00:00
parent 9f1da1f4c5
commit 47bdf5a7b5

View file

@ -224,8 +224,8 @@ sub exportAssetCollateral {
# next, get the contents, open the file, and write the contents to the file.
my $fh = eval { $dest->open('>:utf8') };
if($@) {
WebGUI::Error->throw(error => "can't open " . $dest->absolute->stringify . " for writing: $!");
$exportSession->close;
WebGUI::Error->throw(error => "can't open " . $dest->absolute->stringify . " for writing: $!");
}
$exportSession->asset($selfdupe);
$exportSession->output->setHandle($fh);