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 {
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue