[Moscow.pm] plackup error

Ruslan Zakirov ruslan.zakirov на gmail.com
Вт Ноя 17 06:52:05 PST 2015


Оно явно не будет дружить с psgi так как через print.
Можно вот такое вот использовать для проверки проблемы:

use CGI::Carp qw(fatalsToBrowser set_message);
    BEGIN {
       sub handle_errors {
          my $msg = shift;
          print "<h1>Oh gosh</h1>";
          print "<p>Got an error: $msg</p>";
      }
      set_message(\&handle_errors);
    }


Это пример из доки. В handle_errors можно сделать die $msg и
посмотреть на результат.

Всем кто что-то делает $SIG{__DIE__} полезно знать про $^S
($EXCEPTIONS_BEING_CAUGHT) из perlvar. Только в psgi приложении это
врядли поможет - там скорее всего есть "глобальный" eval.


On Tue, Nov 17, 2015 at 3:44 AM, Nikolay Mishin <mi на ya.ru> wrote:

> Привет, MoscowPM
>
>
> запускаю plackup -I"../lib"  app.psgi (
> https://github.com/mishin/Ftree-cpan/blob/master/cgi-bin/app.psgi)
>
> получаю
>
> The application raised the following error:
>
>   Can't call method "set_default_picture" on an undefined value at
> ../lib/Ftree/FamilyTreeGraphics.pm line 72.
>
> and the StackTrace middleware couldn't catch its stack trace, possibly
> because your application overrides $SIG{__DIE__} by itself, preventing the
> middleware from working correctly. Remove the offending code or module that
> does it: known examples are CGI::Carp and Carp::Always.
>
> я правильно понимаю, что мне нужно закомментировать по всем модулям строки
> use CGI::Carp qw(fatalsToBrowser warningsToBrowser); ?
>
> --
> С уважением
> Николай Мишин
> --
> Moscow.pm mailing list
> moscow-pm на pm.org | http://moscow.pm.org
>



-- 
Best regards, Ruslan.
----------- следущая часть -----------
Вложение в формате HTML было извлечено…
URL: <http://mail.pm.org/pipermail/moscow-pm/attachments/20151117/53b7e78a/attachment-0001.html>


Подробная информация о списке рассылки Moscow-pm