Bugzilla – Attachment 109226 Details for
Bug 26145
Add the ability to attach a cover image at item level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26145: Use Koha::Logger and display the full stacktrace
Bug-26145-Use-KohaLogger-and-display-the-full-stac.patch (text/plain), 2.25 KB, created by
Jonathan Druart
on 2020-08-27 13:26:57 UTC
(
hide
)
Description:
Bug 26145: Use Koha::Logger and display the full stacktrace
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-08-27 13:26:57 UTC
Size:
2.25 KB
patch
obsolete
>From f292fb031158368c10601038fb2b10737641e176 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 27 Aug 2020 15:26:05 +0200 >Subject: [PATCH] Bug 26145: Use Koha::Logger and display the full stacktrace > >--- > Koha/REST/Plugin/PluginRoutes.pm | 4 +++- > Koha/REST/V1.pm | 8 +++++--- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/Plugin/PluginRoutes.pm b/Koha/REST/Plugin/PluginRoutes.pm >index 7643523409..1bd275948d 100644 >--- a/Koha/REST/Plugin/PluginRoutes.pm >+++ b/Koha/REST/Plugin/PluginRoutes.pm >@@ -21,6 +21,7 @@ use Mojo::Base 'Mojolicious::Plugin'; > > use Koha::Exceptions::Plugin; > use Koha::Plugins; >+use Koha::Logger; > > use Clone qw(clone); > use Try::Tiny; >@@ -89,7 +90,8 @@ sub inject_routes { > catch { > my $error = $_; > my $class = ref $plugin; >- warn "Plugin $class route injection failed: $error"; >+ my $logger = Koha::Logger->get({ interface => 'api' }); >+ $logger->error("Plugin $class route injection failed: $error"); > return $spec; > }; > } >diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm >index d884e97fcc..2c24411ec4 100644 >--- a/Koha/REST/V1.pm >+++ b/Koha/REST/V1.pm >@@ -20,6 +20,7 @@ use Modern::Perl; > use Mojo::Base 'Mojolicious'; > > use C4::Context; >+use Koha::Logger; > use Carp; > use JSON::Validator::OpenAPI::Mojolicious; > use Try::Tiny; >@@ -102,9 +103,10 @@ sub startup { > catch { > # Validation of the complete spec failed. Resort to validation one-by-one > # to catch bad ones. >- >+ > # JSON::Validator uses confess, so trim call stack from the message. >- carp "Warning: Could not load REST API spec bundle: " . ($_ =~ /\A(.*?)$/ms)[0]; >+ my $logger = Koha::Logger->get({ interface => 'api' }); >+ $logger->error("Warning: Could not load REST API spec bundle: " . $_); > > try { > $validator->load_and_validate_schema( >@@ -135,7 +137,7 @@ sub startup { > } > catch { > # JSON::Validator uses confess, so trim call stack from the message. >- croak "Could not load REST API spec: " . ($_ =~ /\A(.*?)$/ms)[0]; >+ $logger->error("Warning: Could not load REST API spec bundle: " . $_); > }; > }; > >-- >2.20.1
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 26145
:
109225
|
109226
|
110342
|
110343
|
110344
|
110345
|
110346
|
110347
|
110348
|
110349
|
110350
|
110351
|
110352
|
110353
|
110354
|
110675
|
110676
|
110677
|
110678
|
110679
|
110680
|
110681
|
110682
|
110683
|
110684
|
110685
|
110800
|
110861
|
110862
|
110863
|
110864
|
110865
|
110866
|
110867
|
110868
|
110869
|
110870
|
110871
|
110872
|
110873
|
110874
|
110875
|
111446
|
111447
|
111448
|
111449
|
111450
|
111451
|
111452
|
111453
|
111454
|
111455
|
111456
|
111457
|
111458