diff options
author | bbaetz%acm.org <> | 2003-09-14 15:04:38 +0200 |
---|---|---|
committer | bbaetz%acm.org <> | 2003-09-14 15:04:38 +0200 |
commit | 4e7e3310242bd5264b5f48e4bf3c387e59288b85 (patch) | |
tree | df9878685199a51358c148c1531d51116f32f650 /attachment.cgi | |
parent | 95791d4b9edc26cd55483e71970d9f743f12f094 (diff) | |
download | bugzilla-4e7e3310242bd5264b5f48e4bf3c387e59288b85.tar.gz bugzilla-4e7e3310242bd5264b5f48e4bf3c387e59288b85.tar.xz |
Bug 208699 - Move Throw{Code,Template}Error into Error.pm
r,a=justdave
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-x | attachment.cgi | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/attachment.cgi b/attachment.cgi index 07dbe5e51..d020b4f57 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -153,7 +153,7 @@ elsif ($action eq "update") } else { - ThrowCodeError("unknown_action"); + ThrowCodeError("unknown_action", { action => $action }); } exit; @@ -302,8 +302,8 @@ sub validateContentType } else { - $vars->{'contenttypemethod'} = $::FORM{'contenttypemethod'}; - ThrowCodeError("illegal_content_type_method"); + ThrowCodeError("illegal_content_type_method", + { contenttypemethod => $::FORM{'contenttypemethod'} }); } if ( $::FORM{'contenttype'} !~ /^(application|audio|image|message|model|multipart|text|video)\/.+$/ ) @@ -387,13 +387,11 @@ sub validateObsolete # Make sure the attachment id is valid and the user has permissions to view # the bug to which it is attached. foreach my $attachid (@{$::MFORM{'obsolete'}}) { - # my $vars after ThrowCodeError is updated to not use the global - # vars hash - + my $vars = {}; $vars->{'attach_id'} = $attachid; detaint_natural($attachid) - || ThrowCodeError("invalid_attach_id_to_obsolete"); + || ThrowCodeError("invalid_attach_id_to_obsolete", $vars); SendSQL("SELECT bug_id, isobsolete, description FROM attachments WHERE attach_id = $attachid"); @@ -410,12 +408,12 @@ sub validateObsolete { $vars->{'my_bug_id'} = $::FORM{'bugid'}; $vars->{'attach_bug_id'} = $bugid; - ThrowCodeError("mismatched_bug_ids_on_obsolete"); + ThrowCodeError("mismatched_bug_ids_on_obsolete", $vars); } if ( $isobsolete ) { - ThrowCodeError("attachment_already_obsolete"); + ThrowCodeError("attachment_already_obsolete", $vars); } # Check that the user can modify this attachment |