]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 676844: Replace ThrowCodeError() by ThrowUserError() when the error is not trigge...
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 12 Nov 2012 17:46:48 +0000 (18:46 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 12 Nov 2012 17:46:48 +0000 (18:46 +0100)
r=glob a=LpSolit

18 files changed:
Bugzilla/Attachment.pm
Bugzilla/Flag.pm
Bugzilla/JobQueue.pm
Bugzilla/Util.pm
chart.cgi
editkeywords.cgi
editusers.cgi
jsonrpc.cgi
page.cgi
post_bug.cgi
quips.cgi
report.cgi
reports.cgi
showdependencygraph.cgi
template/en/default/global/code-error.html.tmpl
template/en/default/global/user-error.html.tmpl
votes.cgi
xmlrpc.cgi

index 1c524c24b397b1ef7927357a0712ec9d2686be57..982435a3ac4231b27bdaa2b5514afaf2ebe65824 100644 (file)
@@ -756,7 +756,7 @@ sub validate_obsolete {
         $vars->{'attach_id'} = $attachid;
 
         detaint_natural($attachid)
-          || ThrowCodeError('invalid_attach_id_to_obsolete', $vars);
+          || ThrowUserError('invalid_attach_id', $vars);
 
         # Make sure the attachment exists in the database.
         my $attachment = new Bugzilla::Attachment($attachid)
@@ -771,7 +771,7 @@ sub validate_obsolete {
         if ($attachment->bug_id != $bug->bug_id) {
             $vars->{'my_bug_id'} = $bug->bug_id;
             $vars->{'attach_bug_id'} = $attachment->bug_id;
-            ThrowCodeError('mismatched_bug_ids_on_obsolete', $vars);
+            ThrowUserError('mismatched_bug_ids_on_obsolete', $vars);
         }
 
         next if $attachment->isobsolete;
@@ -879,7 +879,7 @@ sub run_create_validators {
 
     $params->{creation_ts} ||= Bugzilla->dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
     $params->{modification_time} = $params->{creation_ts};
-    $params->{submitter_id} = Bugzilla->user->id || ThrowCodeError('invalid_user');
+    $params->{submitter_id} = Bugzilla->user->id || ThrowUserError('invalid_user');
 
     return $params;
 }
@@ -962,10 +962,18 @@ sub get_content_type {
     return 'text/plain' if ($cgi->param('ispatch') || $cgi->param('attach_text'));
 
     my $content_type;
-    if (!defined $cgi->param('contenttypemethod')) {
-        ThrowUserError("missing_content_type_method");
+    my $method = $cgi->param('contenttypemethod') || '';
+
+    if ($method eq 'list') {
+        # The user selected a content type from the list, so use their
+        # selection.
+        $content_type = $cgi->param('contenttypeselection');
     }
-    elsif ($cgi->param('contenttypemethod') eq 'autodetect') {
+    elsif ($method eq 'manual') {
+        # The user entered a content type manually, so use their entry.
+        $content_type = $cgi->param('contenttypeentry');
+    }
+    else {
         defined $cgi->upload('data') || ThrowUserError('file_not_specified');
         # The user asked us to auto-detect the content type, so use the type
         # specified in the HTTP request headers.
@@ -979,19 +987,6 @@ sub get_content_type {
             $content_type = 'image/png';
         }
     }
-    elsif ($cgi->param('contenttypemethod') eq 'list') {
-        # The user selected a content type from the list, so use their
-        # selection.
-        $content_type = $cgi->param('contenttypeselection');
-    }
-    elsif ($cgi->param('contenttypemethod') eq 'manual') {
-        # The user entered a content type manually, so use their entry.
-        $content_type = $cgi->param('contenttypeentry');
-    }
-    else {
-        ThrowCodeError("illegal_content_type_method",
-                       { contenttypemethod => $cgi->param('contenttypemethod') });
-    }
     return $content_type;
 }
 
index 21241da5ff4004eb2c53385cb2f4944053fb663c..867e08a023e21c4c30229afec6e5e14843fa08f8 100644 (file)
@@ -665,7 +665,7 @@ sub _check_requestee {
         # is specifically requestable. For existing flags, if the requestee
         # was set before the flag became specifically unrequestable, the
         # user can either remove him or leave him alone.
-        ThrowCodeError('flag_requestee_disabled', { type => $self->type })
+        ThrowUserError('flag_requestee_disabled', { type => $self->type })
           if !$self->type->is_requesteeble;
 
         # Make sure the requestee can see the bug.
@@ -719,7 +719,7 @@ sub _check_setter {
     # By default, the currently logged in user is the setter.
     $setter ||= Bugzilla->user;
     (blessed($setter) && $setter->isa('Bugzilla::User') && $setter->id)
-      || ThrowCodeError('invalid_user');
+      || ThrowUserError('invalid_user');
 
     # set_status() has already been called. So this refers
     # to the new flag status.
index 18723446cbd30df1a9a493b215c9f35890158172..faf06c4765496b55a5650af54fbf2773b4db4595 100644 (file)
@@ -40,7 +40,7 @@ sub new {
     my $class = shift;
 
     if (!Bugzilla->feature('jobqueue')) {
-        ThrowCodeError('feature_disabled', { feature => 'jobqueue' });
+        ThrowUserError('feature_disabled', { feature => 'jobqueue' });
     }
 
     my $lc = Bugzilla->localconfig;
index 197a81af45c9348cb767ce848f56fe64aa684973..db25cd27c0839f197ba612ab32c8c2a2ba35ccbf 100644 (file)
@@ -741,7 +741,7 @@ sub detect_encoding {
     my $data = shift;
 
     Bugzilla->feature('detect_charset')
-      || ThrowCodeError('feature_disabled', { feature => 'detect_charset' });
+      || ThrowUserError('feature_disabled', { feature => 'detect_charset' });
 
     require Encode::Detect::Detector;
     import Encode::Detect::Detector 'detect';
index 5f4573fd04ab263376da375faefbee746b0ebaaf..fa1213f89d45972be1fa23871c6e6f94a33d4071 100755 (executable)
--- a/chart.cgi
+++ b/chart.cgi
@@ -52,7 +52,7 @@ my $dbh = Bugzilla->dbh;
 my $user = Bugzilla->login(LOGIN_REQUIRED);
 
 if (!Bugzilla->feature('new_charts')) {
-    ThrowCodeError('feature_disabled', { feature => 'new_charts' });
+    ThrowUserError('feature_disabled', { feature => 'new_charts' });
 }
 
 # Go back to query.cgi if we are adding a boolean chart parameter.
@@ -269,12 +269,12 @@ sub validateWidthAndHeight {
 
     if (defined($vars->{'width'})) {
        (detaint_natural($vars->{'width'}) && $vars->{'width'} > 0)
-         || ThrowCodeError("invalid_dimensions");
+         || ThrowUserError("invalid_dimensions");
     }
 
     if (defined($vars->{'height'})) {
        (detaint_natural($vars->{'height'}) && $vars->{'height'} > 0)
-         || ThrowCodeError("invalid_dimensions");
+         || ThrowUserError("invalid_dimensions");
     }
 
     # The equivalent of 2000 square seems like a very reasonable maximum size.
index 7e14f80cdc901e356d3dd58e28ae4b46c3a70c5c..5a7f6643b1a1db19e370c2d991b540cfa4a9d807 100755 (executable)
@@ -97,7 +97,7 @@ if ($action eq 'new') {
 
 if ($action eq 'edit') {
     my $keyword = new Bugzilla::Keyword($key_id)
-        || ThrowCodeError('invalid_keyword_id', { id => $key_id });
+        || ThrowUserError('invalid_keyword_id', { id => $key_id });
 
     $vars->{'keyword'} = $keyword;
     $vars->{'token'} = issue_session_token('edit_keyword');
@@ -116,7 +116,7 @@ if ($action eq 'edit') {
 if ($action eq 'update') {
     check_token_data($token, 'edit_keyword');
     my $keyword = new Bugzilla::Keyword($key_id)
-        || ThrowCodeError('invalid_keyword_id', { id => $key_id });
+        || ThrowUserError('invalid_keyword_id', { id => $key_id });
 
     $keyword->set_all({
         name        => scalar $cgi->param('name'),
@@ -140,7 +140,7 @@ if ($action eq 'update') {
 
 if ($action eq 'del') {
     my $keyword =  new Bugzilla::Keyword($key_id)
-        || ThrowCodeError('invalid_keyword_id', { id => $key_id });
+        || ThrowUserError('invalid_keyword_id', { id => $key_id });
 
     $vars->{'keyword'} = $keyword;
     $vars->{'token'} = issue_session_token('delete_keyword');
@@ -154,7 +154,7 @@ if ($action eq 'del') {
 if ($action eq 'delete') {
     check_token_data($token, 'delete_keyword');
     my $keyword =  new Bugzilla::Keyword($key_id)
-        || ThrowCodeError('invalid_keyword_id', { id => $key_id });
+        || ThrowUserError('invalid_keyword_id', { id => $key_id });
 
     $keyword->remove_from_db();
 
index 12f7a548d9fd310e20dd45fe546e120a82ee614b..66871e41352da1e61d994191bf5edf0f9e8b93b0 100755 (executable)
@@ -701,7 +701,7 @@ sub check_user {
         $otherUser = new Bugzilla::User({ name => $otherUserLogin });
         $vars->{'user_login'} = $otherUserLogin;
     }
-    ($otherUser && $otherUser->id) || ThrowCodeError('invalid_user', $vars);
+    ($otherUser && $otherUser->id) || ThrowUserError('invalid_user', $vars);
 
     return $otherUser;
 }
index 6a60c9d3ee0e68f41c5ac2eea1bb684ead752930..0b56d57c192aac28f62f493155cf3a4c49411bc6 100755 (executable)
@@ -16,7 +16,7 @@ use Bugzilla::Error;
 use Bugzilla::WebService::Constants;
 BEGIN {
     if (!Bugzilla->feature('jsonrpc')) {
-        ThrowCodeError('feature_disabled', { feature => 'jsonrpc' });
+        ThrowUserError('feature_disabled', { feature => 'jsonrpc' });
     }
 }
 use Bugzilla::WebService::Server::JSONRPC;
index be0dcd7ff3aabcdb104eef379ef26e93b1f1d159..a2aa9d883c049c27e56f804c07e10f4a265bdac6 100755 (executable)
--- a/page.cgi
+++ b/page.cgi
@@ -54,13 +54,13 @@ if ($id) {
     # Be careful not to allow directory traversal.
     if ($id =~ /\.\./) {
         # two dots in a row is bad
-        ThrowCodeError("bad_page_cgi_id", { "page_id" => $id });
+        ThrowUserError("bad_page_cgi_id", { "page_id" => $id });
     }
     # Split into name and ctype.
     $id =~ /^([\w\-\/\.]+)\.(\w+)$/;
     if (!$2) {
         # if this regexp fails to match completely, something bad came in
-        ThrowCodeError("bad_page_cgi_id", { "page_id" => $id });
+        ThrowUserError("bad_page_cgi_id", { "page_id" => $id });
     }
 
     my %vars = ( 
index b38707365e6f59d7f282a927251e7f805c55601d..24fa331b48d38ace4f7c1984c41e6346c156d7fc 100755 (executable)
@@ -199,8 +199,6 @@ $vars->{'bug'} = $bug;
 
 Bugzilla::Hook::process('post_bug_after_creation', { vars => $vars });
 
-ThrowCodeError("bug_error", { bug => $bug }) if $bug->error;
-
 my $recipients = { changer => $user };
 my $bug_sent = Bugzilla::BugMail::Send($id, $recipients);
 $bug_sent->{type} = 'created';
index 4ed40a5479571f3d1d8b9383288056fd33e49d82..bbe53c86e3f80f68ee55822098d2e64d2986c732 100755 (executable)
--- a/quips.cgi
+++ b/quips.cgi
@@ -123,8 +123,7 @@ if ($action eq "delete") {
                                          action => "delete",
                                          object => "quips"});
     my $quipid = $cgi->param("quipid");
-    ThrowCodeError("need_quipid") unless $quipid =~ /(\d+)/; 
-    $quipid = $1;
+    detaint_natural($quipid) || ThrowUserError("need_quipid");
     check_hash_token($token, ['quips', $quipid]);
 
     ($vars->{'deleted_quip'}) = $dbh->selectrow_array(
index e0e1416055b4d59790039392d2a85bb788430beb..de587f1435b8b13b8938076d785dd6b84856776b 100755 (executable)
@@ -110,11 +110,11 @@ my $width = $cgi->param('width') || 1024;
 my $height = $cgi->param('height') || 600;
 
 (detaint_natural($width) && $width > 0)
-  || ThrowCodeError("invalid_dimensions");
+  || ThrowUserError("invalid_dimensions");
 $width <= 2000 || ThrowUserError("chart_too_large");
 
 (detaint_natural($height) && $height > 0)
-  || ThrowCodeError("invalid_dimensions");
+  || ThrowUserError("invalid_dimensions");
 $height <= 2000 || ThrowUserError("chart_too_large");
 
 my $formatparam = $cgi->param('format') || '';
@@ -131,7 +131,7 @@ if ($formatparam eq "table") {
 }
 else {
     if (!Bugzilla->feature('graphical_reports')) {
-        ThrowCodeError('feature_disabled', { feature => 'graphical_reports' });
+        ThrowUserError('feature_disabled', { feature => 'graphical_reports' });
     }
 
     if ($row_field && !$col_field) {
@@ -147,13 +147,13 @@ my $valid_columns = Bugzilla::Search::REPORT_COLUMNS;
 # Validate the values in the axis fields or throw an error.
 !$row_field 
   || ($valid_columns->{$row_field} && trick_taint($row_field))
-  || ThrowCodeError("report_axis_invalid", {fld => "x", val => $row_field});
+  || ThrowUserError("report_axis_invalid", {fld => "x", val => $row_field});
 !$col_field 
   || ($valid_columns->{$col_field} && trick_taint($col_field))
-  || ThrowCodeError("report_axis_invalid", {fld => "y", val => $col_field});
+  || ThrowUserError("report_axis_invalid", {fld => "y", val => $col_field});
 !$tbl_field 
   || ($valid_columns->{$tbl_field} && trick_taint($tbl_field))
-  || ThrowCodeError("report_axis_invalid", {fld => "z", val => $tbl_field});
+  || ThrowUserError("report_axis_invalid", {fld => "z", val => $tbl_field});
 
 my @axis_fields = grep { $_ } ($row_field, $col_field, $tbl_field);
 
index c931b1586b092473ebbe68b901e5f7b073f54c78..618feb8c88b2829efda27ab3ed70429afbecd96a 100755 (executable)
@@ -31,7 +31,7 @@ my $product_all = {id => 0};
 bless($product_all, 'Bugzilla::Product');
 
 if (!Bugzilla->feature('old_charts')) {
-    ThrowCodeError('feature_disabled', { feature => 'old_charts' });
+    ThrowUserError('feature_disabled', { feature => 'old_charts' });
 }
 
 my $dir       = bz_locations()->{'datadir'} . "/mining";
index 67faced198f3e992cc9486c00fb992c5bbb41a4e..2f10551a15dd193cc0dffc89eef42a32d809dfc7 100755 (executable)
@@ -81,7 +81,7 @@ sub AddLink {
     }
 }
 
-ThrowCodeError("missing_bug_id") if !defined $cgi->param('id');
+ThrowUserError("missing_bug_id") unless $cgi->param('id');
 
 # The list of valid directions. Some are not proposed in the dropdrown
 # menu despite the fact that they are valid.
index 8945ba445f13e7d0b252b9f1baabb7e77a2a2616..89ebd0e541aa642761c49ee56048a6beabd29fed 100644 (file)
     The result value of [% value FILTER html %] was not handled by
     the login code.
 
-  [% ELSIF error == "bad_page_cgi_id" %]
-    [% title = "Invalid Page ID" %]
-    The ID <code>[% page_id FILTER html %]</code> is not a
-    valid page identifier.
-
   [% ELSIF error == "bad_arg" %]
     Bad argument <code>[% argument FILTER html %]</code> sent to
     <code>[% function FILTER html %]</code> function.
       address.
     [% END %]
 
-  [% ELSIF error == "extension_disabled" %]
-    [% title = "Extension Disabled" %]
-    You cannot access this page because the extension '[% name FILTER html %]'
-    is disabled.
-
   [% ELSIF error == "extension_must_be_subclass" %]
     <code>[% package FILTER html %]</code> from 
     <code>[% filename FILTER html %]</code> is not a subclass of
     [% title = "Field Type Not Specified" %]
     You must specify a type when creating a custom field.
 
-  [% ELSIF error == "illegal_content_type_method" %]
-    Your form submission got corrupted somehow.  The <em>content
-    method</em> field, which specifies how the content type gets determined,
-    should have been either <em>autodetect</em>, <em>list</em>,
-    or <em>manual</em>, but was instead
-    <em>[% contenttypemethod FILTER html %]</em>.
-
   [% ELSIF error == "illegal_field" %]
     A legal [% field FILTER html %] was not set.
 
-  [% ELSIF error == "invalid_attach_id_to_obsolete" %]
-     The attachment number of one of the attachments you wanted to obsolete,
-     [%+ attach_id FILTER html %], is invalid.
-          
   [% ELSIF error == "invalid_customfield_type" %]
     [% title = "Invalid Field Type" %]
     The type <em>[% type FILTER html %]</em> is not a valid field type.
 
-  [% ELSIF error == "invalid_dimensions" %]
-    [% title = "Invalid Dimensions" %]
-    The width or height specified is not a positive integer.
-
   [% ELSIF error == "invalid_feature" %]
     [% title = "Invalid Feature Name" %]
     [% feature FILTER html %] is not a valid feature name. See
     There is no such group: [% group FILTER html %]. Check your $webservergroup
     setting in [% constants.bz_locations.localconfig FILTER html %].
 
-  [% ELSIF error == "mismatched_bug_ids_on_obsolete" %]
-    Attachment [% attach_id FILTER html %] ([% description FILTER html %]) 
-    is attached to [% terms.bug %] [%+ attach_bug_id FILTER html %], 
-    but you tried to flag it as obsolete while creating a new attachment to 
-    [%+ terms.bug %] [%+ my_bug_id FILTER html %].
-
-  [% ELSIF error == "feature_disabled" %]
-    The [% install_string("feature_$feature") FILTER html %] feature is not
-    available in this [% terms.Bugzilla %]. 
-    [% IF user.in_group('admin') %]
-      If you would like to enable this feature, please run 
-      <kbd>checksetup.pl</kbd> to see how to install the necessary
-      requirements for this feature.
-    [% END %]
-
   [% ELSIF error == "flag_unexpected_object" %]
     [% title = "Object Not Recognized" %]
     Flags cannot be set for objects of type [% caller FILTER html %].
     They can only be set for [% terms.bugs %] and attachments.
 
-  [% ELSIF error == "flag_requestee_disabled" %]
-    [% title = "Flag not Requestable from Specific Person" %]
-    You can't ask a specific person for
-    <em>[% type.name FILTER html %]</em>.
-  
   [% ELSIF error == "flag_type_inactive" %]
     [% title = "Inactive Flag Type" %]
     The flag type [% type FILTER html %] is inactive and cannot be used
   [% ELSIF error == "invalid_field_name" %]
     Can't use [% field FILTER html %] as a field name.
 
-  [% ELSIF error == "invalid_keyword_id" %]
-    The keyword ID <em>[% id FILTER html %]</em> couldn't be
-    found.
-
-  [% ELSIF error == "invalid_user" %]
-    [% title = "Invalid User" %]
-    There is no user account
-    [% IF user_id %]
-      with ID <em>[% user_id FILTER html %]</em>.
-    [% ELSIF user_login %]
-      with login name <em>[% user_login FILTER html %]</em>.
-    [% ELSE %]
-      given.
-    [% END %]
-
   [% ELSIF error == "jobqueue_insert_failed" %]
    [% title = "Job Queue Failure" %]
     Inserting a <code>[% job FILTER html %]</code> job into the Job 
     to '[% mail.header('To') FILTER html %]':
     [%+ msg FILTER html %]
 
-  [% ELSIF error == "missing_bug_id" %]
-    No [% terms.bug %] ID was given.
-    
   [% ELSIF error == "missing_series_id" %]
     Having inserted a series into the database, no series_id was returned for
     it. Series: [% series.category FILTER html %] / 
     [%+ series.subcategory FILTER html %] / 
     [%+ series.name FILTER html %].
-    
-  [% ELSIF error == "need_quipid" %]
-    A valid quipid is needed.
 
   [% ELSIF error == "object_dep_sort_loop" %]
     There is a loop in VALIDATOR_DEPENDENCIES involving
     An error occurred while preparing for a RADIUS authentication request:
     <code>[% errstr FILTER html %]</code>.
 
-  [% ELSIF error == "report_axis_invalid" %]
-    <em>[% val FILTER html %]</em> is not a valid value for 
-    [%+ IF    fld == "x" %]the horizontal axis
-    [%+ ELSIF fld == "y" %]the vertical axis
-    [%+ ELSIF fld == "z" %]the multiple tables/images
-    [%+ ELSE %]a report axis[% END %] field.
-
   [% ELSIF error == "search_cp_without_op" %]
     Search argument f[% id FILTER html %] is "CP" but there is no
     matching "OP" before it.
index e7d3061a9875c07b9c1e1b26b8bae24782567c56..6a34cbd0d7d3b73f512f412c126e8c1149d984eb 100644 (file)
     [% title = "Attachment Removed" %]
     The attachment you are attempting to access has been removed.
 
+  [% ELSIF error == "bad_page_cgi_id" %]
+    [% title = "Invalid Page ID" %]
+    The ID <code>[% page_id FILTER html %]</code> is not a
+    valid page identifier.
+
   [% ELSIF error == "bug_access_denied" %]
     [% title = "$terms.Bug Access Denied" %]
     [% admindocslinks = {'groups.html' => 'Group Security'} %]
   [% ELSIF error == "extension_create_no_name" %]
     You must specify a name for your extension, as an argument to this script.
 
+  [% ELSIF error == "extension_disabled" %]
+    [% title = "Extension Disabled" %]
+    You cannot access this page because the extension '[% name FILTER html %]'
+    is disabled.
+
   [% ELSIF error == "extension_first_letter_caps" %]
     The first letter of your extension's name must be a capital letter.
     (You specified '[% name FILTER html %]'.)
 
+  [% ELSIF error == "feature_disabled" %]
+    The [% install_string("feature_$feature") FILTER html %] feature is not
+    available in this [% terms.Bugzilla %].
+    [% IF user.in_group('admin') %]
+      If you would like to enable this feature, please run
+      <kbd>checksetup.pl</kbd> to see how to install the necessary
+      requirements for this feature.
+    [% END %]
+
   [% ELSIF error == "field_already_exists" %]
     [% title = "Field Already Exists" %]
     The field '[% field.name FILTER html %]'     
     <br>Alternately, if your attachment is an image, you could convert
     it to a compressible format like JPG or PNG and try again.
 
+  [% ELSIF error == "flag_requestee_disabled" %]
+    [% title = "Flag not Requestable from Specific Person" %]
+    You can't ask a specific person for <em>[% type.name FILTER html %]</em>.
+
   [% ELSIF error == "flag_requestee_needs_privs" %]
     [% title = "Flag Requestee Needs Privileges" %]
     [% requestee.identity FILTER html %] does not have permission to set the
     Invalid datasets <em>[% datasets.join(":") FILTER html %]</em>. Only digits,
     letters and colons are allowed.
 
+  [% ELSIF error == "invalid_dimensions" %]
+    [% title = "Invalid Dimensions" %]
+    The width or height specified is not a positive integer.
+
   [% ELSIF error == "invalid_format" %]
     [% title = "Invalid Format" %]
     The format "[% format FILTER html %]" is invalid (must be one of
     [% title = "Invalid group name" %]
     The group you specified, [% name FILTER html %], is not valid here.
 
+  [% ELSIF error == "invalid_keyword_id" %]
+    The keyword ID <em>[% id FILTER html %]</em> couldn't be found.
+
   [% ELSIF error == "invalid_maxrows" %]
     [% title = "Invalid Max Rows" %]
     The maximum number of rows, '[% maxrows FILTER html %]', must be
     [% title = "Invalid regular expression" %]
     The regular expression you entered is invalid.
 
+  [% ELSIF error == "invalid_user" %]
+    [% title = "Invalid User" %]
+    There is no user account
+    [% IF user_id %]
+      with ID <em>[% user_id FILTER html %]</em>.
+    [% ELSIF user_login %]
+      with login name <em>[% user_login FILTER html %]</em>.
+    [% ELSE %]
+      given.
+    [% END %]
+
   [% ELSIF error == "invalid_user_group" %]
     [% title = "Invalid User Group" %]
     [% IF users.size > 1 %] Users [% ELSE %] User [% END %]
     [% title = "Misarranged Dates" %]
     Your start date ([% datefrom FILTER html %]) is after 
     your end date ([% dateto FILTER html %]).
-    
+
+  [% ELSIF error == "mismatched_bug_ids_on_obsolete" %]
+    Attachment [% attach_id FILTER html %] is attached to another [% terms.bug %],
+    but you tried to flag it as obsolete while creating a new attachment to
+    [%+ terms.bug %] [%+ my_bug_id FILTER html %].
+
   [% ELSIF error == "missing_attachment_description" %]
     [% title = "Missing Attachment Description" %]
     You must enter a description for the attachment.
-    
+
+  [% ELSIF error == "missing_bug_id" %]
+    [% title = "Missing $terms.Bug ID" %]
+    No [% terms.bug %] ID was given.
+
   [% ELSIF error == "missing_category" %]
     [% title = "Missing Category" %]
     You did not specify a category for this series.
      You asked [% terms.Bugzilla %] to auto-detect the content type, but
      your browser did not specify a content type when uploading the file, 
      so you must enter a content type manually.
-                
-  [% ELSIF error == "missing_content_type_method" %]
-    [% title = "Missing Content-Type Determination Method" %]
-    You must choose a method for determining the content type,
-    either <em>auto-detect</em>, <em>select from list</em>, or <em>enter 
-    manually</em>.
-        
+
   [% ELSIF error == "missing_cookie" %]
     [% title = "Missing Cookie" %]
     Sorry, I seem to have lost the cookie that recorded
       does not exist.
     [% END %]
 
+  [% ELSIF error == "need_quipid" %]
+    [% title = "Missing Quip ID" %]
+    A valid quip ID is needed.
+
   [% ELSIF error == "missing_resolution" %]
     [% title = "Resolution Required" %]
     A valid resolution is required to mark [% terms.bugs %] as
     To reassign [% terms.abug %], you must provide an address for
     the new assignee.
 
+  [% ELSIF error == "report_axis_invalid" %]
+    [% title = "Invalid Axis" %]
+    <em>[% val FILTER html %]</em> is not a valid value for
+    [%+ IF    fld == "x" %]the horizontal axis
+    [%+ ELSIF fld == "y" %]the vertical axis
+    [%+ ELSIF fld == "z" %]the multiple tables/images
+    [%+ ELSE %]a report axis[% END %] field.
+
   [% ELSIF error == "report_name_missing" %]
     [% title = "No Report Name Specified" %]
     You must enter a name for your report.
index 032dc1b8ae0ae62eb19f743102a315c1ba48221a..45a8b081561f0a95c7022ce19d176ad165630cc8 100755 (executable)
--- a/votes.cgi
+++ b/votes.cgi
@@ -17,7 +17,7 @@ use Bugzilla;
 use Bugzilla::Error;
 
 my $is_enabled = grep { $_->NAME eq 'Voting' } @{ Bugzilla->extensions };
-$is_enabled || ThrowCodeError('extension_disabled', { name => 'Voting' });
+$is_enabled || ThrowUserError('extension_disabled', { name => 'Voting' });
 
 my $cgi = Bugzilla->cgi;
 my $action = $cgi->param('action') || 'show_user';
index a8092b25d185dfa8224aa0314663235470f384a7..5fff5f7e106e0e2f4445d5823cfd382abb857309 100755 (executable)
@@ -16,7 +16,7 @@ use Bugzilla::Error;
 use Bugzilla::WebService::Constants;
 BEGIN {
     if (!Bugzilla->feature('xmlrpc')) {
-        ThrowCodeError('feature_disabled', { feature => 'xmlrpc' });
+        ThrowUserError('feature_disabled', { feature => 'xmlrpc' });
     }
 }
 use Bugzilla::WebService::Server::XMLRPC;