Bugzilla – Attachment 90594 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
David Nind
on 2019-06-14 11:46:04 UTC
(
hide
)
Description:
Bug 23075: Better error handling in Mana config
Filename:
MIME Type:
Creator:
David Nind
Created:
2019-06-14 11:46:04 UTC
Size:
2.06 KB
patch
obsolete
>From 28956c1e468f2f2827b7c44ad69ee81f8d3afce0 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. > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/SharedContent.pm | 7 +++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/admin/share_content.tt | 2 +- > 2 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm >index 7145e950c3..d2129d965e 100644 >--- a/Koha/SharedContent.pm >+++ b/Koha/SharedContent.pm >@@ -52,6 +52,13 @@ sub process_request { > > my $response = $userAgent->request($mana_request); > >+ if ( $response->code != 200 ) { >+ return { >+ code => $response->code, >+ msg => $response->message, >+ }; >+ } >+ > eval { $result = from_json( $response->decoded_content, { utf8 => 1} ); }; > $result->{code} = $response->code; > if ( $@ ){ >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