Bugzilla – Attachment 90440 Details for
Bug 23075
Incorrect URL should have a meaningful error message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23075: Better error handling in Mana config
Bug-23075-Better-error-handling-in-Mana-config.patch (text/plain), 2.06 KB, created by
Jonathan Druart
on 2019-06-08 18:59:31 UTC
(
hide
)
Description:
Bug 23075: Better error handling in Mana config
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-06-08 18:59:31 UTC
Size:
2.06 KB
patch
obsolete
>From 3b41286ec1ae740426343d393420adbf7121191f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 8 Jun 2019 13:57:05 -0500 >Subject: [PATCH] Bug 23075: Better error handling in Mana config > >Currently, if you input an incorrect mana service URL in your config >(http rather than https for example) the error message you are given is >the direct output of a failed json parse. We should be able to catch >such failures and display a more meaningful error to the end user. > >This patch makes it display a more friendly message. >--- > Koha/SharedContent.pm | 7 ++++++- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt | 2 +- > 2 files changed, 7 insertions(+), 2 deletions(-) > >diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm >index 7145e950c3..2317f3446f 100644 >--- a/Koha/SharedContent.pm >+++ b/Koha/SharedContent.pm >@@ -51,9 +51,14 @@ sub process_request { > } > > my $response = $userAgent->request($mana_request); >+ $result->{code} = $response->code; >+ >+ if ( $response->code != 200 ) { >+ $result->{msg} = $response->message; >+ return $result; >+ } > > eval { $result = from_json( $response->decoded_content, { utf8 => 1} ); }; >- $result->{code} = $response->code; > if ( $@ ){ > $result->{msg} = $@; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt >index 11d4e6c196..df8599e64e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt >@@ -19,7 +19,7 @@ > <div class="col-sm-6"> > [% IF result.code != 201 && result.msg %] > <div class="dialog alert" role="alert"> >- [% result.msg | html %] >+ Error trying to connect or read response from the Mana server (Code: [% result.code | html %]) [% result.msg | html %] > </div> > [% END %] > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23075
:
90440
|
90459
|
90594
|
90595
|
90596
|
90606
|
90682
|
94098
|
94363
|
95000
|
95003
|
95009
|
95074
|
95075
|
95076
|
95078
|
95079
|
95080
|
95081