clarify returning from try/catch

This commit is contained in:
Doug Bell 2011-05-17 15:27:37 -05:00
parent 587d494501
commit 72d32d679d

View file

@ -73,17 +73,19 @@ sub _template_content {
sub getAsset {
my ( $self, $id ) = @_;
try {
return WebGUI::Asset->newByUrl( $self->session, $id );
my ( $asset );
try {
$asset = WebGUI::Asset->newByUrl( $self->session, $id );
}
catch {
try {
return WebGUI::Asset->newById( $self->session, $id );
$asset = WebGUI::Asset->newById( $self->session, $id );
}
catch {
die "Could not find asset $id to include in template: " . $_;
};
};
return $asset;
}
1;