Skip Menu |

This queue is for tickets about the Mojolicious-Plugin-PlackMiddleware CPAN distribution.

Report information
The Basics
Id: 132581
Status: new
Priority: 0/
Queue: Mojolicious-Plugin-PlackMiddleware

People
Owner: Nobody in particular
Requestors: larryl [...] emailplus.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Error handling is broken
Date: Thu, 14 May 2020 09:28:30 -0600
To: bug-Mojolicious-Plugin-PlackMiddleware [...] rt.cpan.org
From: "Larry Leszczynski" <larryl [...] emailplus.org>
Using Mojolicious::Plugin::PlackMiddleware version 0.36 This code at line 225 in the Mojolicious::Plugin::PlackMiddleware::_EH package mishandles its arguments (the shifts don't happen in the order the code expects): sub print { shift->handler->(shift); } It should be something like: sub print { my ($self, $error) = @_; $self->handler->($error); } The bug can be reproduced like so: $ perl -Ilib -MMojolicious::Plugin::PlackMiddleware -E ' package Foo; our @ISA = qw(Mojolicious::Plugin::PlackMiddleware::_EH); package main; my $a = Foo->new(handler => sub { print @_ }); $a->print("THIS");' Can't locate object method "handler" via package "THIS" (perhaps you forgot to load "THIS"?)
Subject: Re: [rt.cpan.org #132581] Error handling is broken
Date: Thu, 14 May 2020 09:40:06 -0600
To: "Bugs in Mojolicious-Plugin-PlackMiddleware via RT" <bug-Mojolicious-Plugin-PlackMiddleware [...] rt.cpan.org>
From: "Larry Leszczynski" <larryl [...] emailplus.org>
Show quoted text
> The bug can be reproduced like so: > > $ perl -Ilib -MMojolicious::Plugin::PlackMiddleware -E ' > package Foo; > our @ISA = qw(Mojolicious::Plugin::PlackMiddleware::_EH); > package main; > my $a = Foo->new(handler => sub { print @_ }); > $a->print("THIS");' > Can't locate object method "handler" via package "THIS" (perhaps > you forgot to load "THIS"?)
Sorry, this part in the instructions to reproduce the bug: my $a = Foo->new(handler => sub { print @_ }); should be: my $a = Foo->new(sub { print @_ });