Bug 1036225: Return a link to the REST documentation in "method not found" errors

r=glob,a=glob


git-svn-id: svn://10.0.0.236/trunk@265458 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2014-07-10 16:30:58 +00:00
parent 022f98defe
commit 7acf45d41f
4 changed files with 8 additions and 2 deletions

View File

@ -1 +1 @@
9081 9082

View File

@ -1 +1 @@
8dbd57d5cb91bdc1ab6f13018c2ca1163dddef82 551eb6d2f6ed6da115b3ab51a966628ac445e29f

View File

@ -18,6 +18,7 @@ use Memoize;
@Bugzilla::Constants::EXPORT = qw( @Bugzilla::Constants::EXPORT = qw(
BUGZILLA_VERSION BUGZILLA_VERSION
REST_DOC
REMOTE_FILE REMOTE_FILE
LOCAL_FILE LOCAL_FILE
@ -198,6 +199,10 @@ use Memoize;
# Bugzilla version # Bugzilla version
use constant BUGZILLA_VERSION => "4.5.4+"; use constant BUGZILLA_VERSION => "4.5.4+";
# A base link to the current REST Documentation. We place it here
# as it will need to be updated to whatever the current release is.
use constant REST_DOC => "http://www.bugzilla.org/docs/tip/en/html/api/";
# Location of the remote and local XML files to track new releases. # Location of the remote and local XML files to track new releases.
use constant REMOTE_FILE => 'http://updates.bugzilla.org/bugzilla-update.xml'; use constant REMOTE_FILE => 'http://updates.bugzilla.org/bugzilla-update.xml';
use constant LOCAL_FILE => 'bugzilla-update.xml'; # Relative to datadir. use constant LOCAL_FILE => 'bugzilla-update.xml'; # Relative to datadir.

View File

@ -120,6 +120,7 @@ sub response {
if (exists $json_data->{error}) { if (exists $json_data->{error}) {
$result = $json_data->{error}; $result = $json_data->{error};
$result->{error} = $self->type('boolean', 1); $result->{error} = $self->type('boolean', 1);
$result->{documentation} = REST_DOC;
delete $result->{'name'}; # Remove JSONRPCError delete $result->{'name'}; # Remove JSONRPCError
} }
elsif (exists $json_data->{result}) { elsif (exists $json_data->{result}) {