404 fix

fix exception handling
Merge pull request #1036 from apagac/tmp_up_fix_404

Template upload: fix 404 error