X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/87f46582f518e48d3875864bfc490a52be739520..c1b80c54fa4915bb7174dd4333e9ced40dfee770:/IkiWiki/Plugin/attachment.pm?ds=inline diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 83dd120f6..d56dd18ad 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -229,8 +229,10 @@ sub attachment_store { check_canattach($session, $final_filename, $tempfile); }; if ($@) { - json_response($q, $form, $dest."/".$filename, $@); - error $@; + # save error in case called functions clobber $@ + my $error = $@; + json_response($q, $form, $dest."/".$filename, $error); + error $error; } # Move the attachment into holding directory.