Giter Club home page Giter Club logo

whoops-silex's People

Contributors

mathroc avatar mtotheikle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

whoops-silex's Issues

Identifier "dispatcher_class" is not defined

Hi,

When trying to use this with Silex 2.0 I'm seeing this error:

2015/04/09 09:13:24 [error] 968#0: *51 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'Identifier "d" is not defined.' in /vagrant/vendor/pimple/pimple/src/Pimple/Container.php:95
Stack trace: 
#0 /vagrant/vendor/texthtml/whoops-silex/src/SilexApplicationHandler.php(30): Pimple\Container->offsetGet('dispatcher_clas...')
#1 /vagrant/vendor/filp/whoops/src/Whoops/Run.php(256): WhoopsSilex\SilexApplicationHandler->handle(Object(InvalidArgumentException))
#2 [internal function]: Whoops\Run->handleException(Object(InvalidArgumentException))
#3 {main}
  thrown in /vagrant/vendor/pimple/pimple/src/Pimple/Container.php on line 95
PHP message: PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'Identifier "dispatcher_class" is not defined.' in /vagrant/vendor/pimple/pimple/src/Pimple/Container.php:95
Stack trace: 
#0 /vagrant/vendor/texthtml/whoops-silex/src/SilexApplicationHandler.php(30): Pimple\Container->offsetGet('dispatcher_clas...')
#1 /vagrant/vendor/filp/whoops/src/Whoops/Run.php(256): WhoopsSilex\SilexApplicationHandler->handle(Object(Whoops\Exception\ErrorException))
#2 /vagrant/vendor/filp/whoops/src/Whoops/Run.php(327): Whoops\Run->handleException(Object(Whoops\Exception\ErrorException))
#3 /vagrant/vendor/filp/whoops/src/Whoops/Run.php(357): Whoops\Run->handleError(1, 'Uncaught except...', '/vagrant/vendor...', 95)
#4 [internal function]: Whoops\Run->handleShutdown()
#5 {main}
  thrown in /vagrant/vendor/pimple/pimple/src/Pimple/Container.php on line 95" while reading response header from upstream, client: 10.40.41.1, server: vagrantbox, request: "GET /api/v0/chain/tsh/hotels/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "10.40.41.42"

Here's my lockfile for specific version numbers: https://gist.github.com/EdwardIII/8f6621a7fddf1c2edf17

JsonResponseHandler returns text/html header?

Not sure if this is an issue with Whoops or Silex+Whoops.

I use the JsonResponseHandler:

$app->register(new WhoopsSilex\WhoopsServiceProvider());
$app['whoops']->pushHandler(new Whoops\Handler\JsonResponseHandler);

In my response I get this header though:

Content-Type:text/html; charset=UTF-8

As far as I can see, Whoops is trying to do the right thing:

https://github.com/filp/whoops/blob/master/src/Whoops/Handler/JsonResponseHandler.php#L84

It does hit this pathway and add the Content-Type header:

        if (\Whoops\Util\Misc::canSendHeaders()) {
            header('Content-Type: application/json');
        }

And if I put a die before it returns Handler::QUIT then the response does come back with application/json:

        echo json_encode($response);
        die(); # I then see application/json as the header in the output
        return Handler::QUIT;

Any idea how I can diagnose whether this is a bug in Whoops or something that's happening between Whoops/Silex?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.