From 2a6f7d4663dfc5cb00c1bb8b8d8139869a22d461 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Mon, 12 Nov 2012 18:46:48 +0100 Subject: Bug 676844: Replace ThrowCodeError() by ThrowUserError() when the error is not triggered by the code itself r=glob a=LpSolit --- template/en/default/global/code-error.html.tmpl | 73 ------------------------ template/en/default/global/user-error.html.tmpl | 74 ++++++++++++++++++++++--- 2 files changed, 65 insertions(+), 82 deletions(-) (limited to 'template') diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index 8945ba445..89ebd0e54 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -40,11 +40,6 @@ 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 [% page_id FILTER html %] is not a - valid page identifier. - [% ELSIF error == "bad_arg" %] Bad argument [% argument FILTER html %] sent to [% function FILTER html %] function. @@ -128,11 +123,6 @@ 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" %] [% package FILTER html %] from [% filename FILTER html %] is not a subclass of @@ -179,28 +169,13 @@ [% 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 content - method field, which specifies how the content type gets determined, - should have been either autodetect, list, - or manual, but was instead - [% contenttypemethod FILTER html %]. - [% 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 [% type FILTER html %] 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 @@ -229,31 +204,11 @@ 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 - checksetup.pl 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 - [% type.name FILTER html %]. - [% ELSIF error == "flag_type_inactive" %] [% title = "Inactive Flag Type" %] The flag type [% type FILTER html %] is inactive and cannot be used @@ -266,21 +221,6 @@ [% ELSIF error == "invalid_field_name" %] Can't use [% field FILTER html %] as a field name. - [% ELSIF error == "invalid_keyword_id" %] - The keyword ID [% id FILTER html %] couldn't be - found. - - [% ELSIF error == "invalid_user" %] - [% title = "Invalid User" %] - There is no user account - [% IF user_id %] - with ID [% user_id FILTER html %]. - [% ELSIF user_login %] - with login name [% user_login FILTER html %]. - [% ELSE %] - given. - [% END %] - [% ELSIF error == "jobqueue_insert_failed" %] [% title = "Job Queue Failure" %] Inserting a [% job FILTER html %] job into the Job @@ -322,17 +262,11 @@ 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 @@ -391,13 +325,6 @@ An error occurred while preparing for a RADIUS authentication request: [% errstr FILTER html %]. - [% ELSIF error == "report_axis_invalid" %] - [% val FILTER html %] 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. diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index e7d3061a9..6a34cbd0d 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -225,6 +225,11 @@ [% 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 [% page_id FILTER html %] is not a + valid page identifier. + [% ELSIF error == "bug_access_denied" %] [% title = "$terms.Bug Access Denied" %] [% admindocslinks = {'groups.html' => 'Group Security'} %] @@ -456,10 +461,24 @@ [% 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 + checksetup.pl 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 %]' @@ -614,6 +633,10 @@
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 [% type.name FILTER html %]. + [% ELSIF error == "flag_requestee_needs_privs" %] [% title = "Flag Requestee Needs Privileges" %] [% requestee.identity FILTER html %] does not have permission to set the @@ -937,6 +960,10 @@ Invalid datasets [% datasets.join(":") FILTER html %]. 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 @@ -953,6 +980,9 @@ [% title = "Invalid group name" %] The group you specified, [% name FILTER html %], is not valid here. + [% ELSIF error == "invalid_keyword_id" %] + The keyword ID [% id FILTER html %] couldn't be found. + [% ELSIF error == "invalid_maxrows" %] [% title = "Invalid Max Rows" %] The maximum number of rows, '[% maxrows FILTER html %]', must be @@ -966,6 +996,17 @@ [% 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 [% user_id FILTER html %]. + [% ELSIF user_login %] + with login name [% user_login FILTER html %]. + [% ELSE %] + given. + [% END %] + [% ELSIF error == "invalid_user_group" %] [% title = "Invalid User Group" %] [% IF users.size > 1 %] Users [% ELSE %] User [% END %] @@ -1106,11 +1147,20 @@ [% 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. @@ -1135,13 +1185,7 @@ 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 auto-detect, select from list, or enter - manually. - + [% ELSIF error == "missing_cookie" %] [% title = "Missing Cookie" %] Sorry, I seem to have lost the cookie that recorded @@ -1174,6 +1218,10 @@ 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 @@ -1485,6 +1533,14 @@ To reassign [% terms.abug %], you must provide an address for the new assignee. + [% ELSIF error == "report_axis_invalid" %] + [% title = "Invalid Axis" %] + [% val FILTER html %] 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. -- cgit v1.2.3-24-g4f1b