clarify returning from try/catch
This commit is contained in:
parent
587d494501
commit
72d32d679d
1 changed files with 5 additions and 3 deletions
|
|
@ -73,17 +73,19 @@ sub _template_content {
|
||||||
|
|
||||||
sub getAsset {
|
sub getAsset {
|
||||||
my ( $self, $id ) = @_;
|
my ( $self, $id ) = @_;
|
||||||
try {
|
my ( $asset );
|
||||||
return WebGUI::Asset->newByUrl( $self->session, $id );
|
try {
|
||||||
|
$asset = WebGUI::Asset->newByUrl( $self->session, $id );
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
try {
|
try {
|
||||||
return WebGUI::Asset->newById( $self->session, $id );
|
$asset = WebGUI::Asset->newById( $self->session, $id );
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
die "Could not find asset $id to include in template: " . $_;
|
die "Could not find asset $id to include in template: " . $_;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
return $asset;
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue