When FileUrl returns an error message instead of a filename and the thing hotlinks it (eg, img src),
the evidence of the problem doesn't show up until the next hit. Even more fun, the error message gets lower-case-ified as part of conicialization so if you ack for it without -i, you won't even find where the error came from. So perhaps it's best to log the error sooner than later.
This commit is contained in:
parent
922e4cef37
commit
078f5587c7
1 changed files with 3 additions and 0 deletions
|
|
@ -45,14 +45,17 @@ sub process {
|
|||
my $asset = WebGUI::Asset->newByUrl($session,$url);
|
||||
my $i18n = WebGUI::International->new($session, 'Macro_FileUrl');
|
||||
if (not defined $asset) {
|
||||
$session->log->warn("Invalid Asset URL for url: " . $url);
|
||||
return $i18n->get('invalid url');
|
||||
}
|
||||
my $storageId = $asset->get('storageId');
|
||||
if (not defined $storageId) {
|
||||
$session->log->warn("No Storage Location for assetId: " . $asset->getId . " url: $url");
|
||||
return $i18n->get('no storage');
|
||||
}
|
||||
my $filename = $asset->get('filename');
|
||||
if (not defined $filename) {
|
||||
$session->log->warn("No Filename for assetId: " . $asset->getId . " url: $url");
|
||||
return $i18n->get('no filename');
|
||||
}
|
||||
my $storage = WebGUI::Storage->get($session,$storageId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue