summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDylan Hardison <dylan@mozilla.com>2015-11-13 16:59:28 +0100
committerDylan Hardison <dylan@mozilla.com>2015-11-13 16:59:28 +0100
commit2c3a83913a61f3d81020db658a5679741661d7ca (patch)
tree8f042efa69f1ddee513468c3d2ec69529f47ed21 /extensions
parent771547cd05b0266e4e0cf5682bb0e350f931a3bd (diff)
downloadbugzilla-2c3a83913a61f3d81020db658a5679741661d7ca.tar.gz
bugzilla-2c3a83913a61f3d81020db658a5679741661d7ca.tar.xz
Bug 1209625 - MozReview API Keys should use a more specific error message
Diffstat (limited to 'extensions')
-rw-r--r--extensions/MozReview/Extension.pm2
-rw-r--r--extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl11
2 files changed, 12 insertions, 1 deletions
diff --git a/extensions/MozReview/Extension.pm b/extensions/MozReview/Extension.pm
index f16c6008b..621e81f43 100644
--- a/extensions/MozReview/Extension.pm
+++ b/extensions/MozReview/Extension.pm
@@ -100,7 +100,7 @@ sub webservice_before_call {
my $app_id = $getter->app_id;
if ($app_id eq $mozreview_app_id) {
unless (any { $full_method eq $_ } @METHOD_WHITELIST) {
- ThrowCodeError('unknown_method', { method => $full_method });
+ ThrowUserError('forbidden_method', { method => $full_method });
}
}
}
diff --git a/extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl
new file mode 100644
index 000000000..4599b8398
--- /dev/null
+++ b/extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl
@@ -0,0 +1,11 @@
+[%# This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ #
+ # This Source Code Form is "Incompatible With Secondary Licenses", as
+ # defined by the Mozilla Public License, v. 2.0.
+ #%]
+
+[% IF error == "forbidden_method" %]
+ The requested method '[% method FILTER html %]' is not allowed to be called using the current API Key.
+[% END %]