Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Argument 1 passed to ZendDeveloperTools\Exception\SerializableException::__construct() must be an instance of Exception #216

Closed
seaneble opened this issue Jun 29, 2016 · 7 comments

Comments

@seaneble
Copy link

The phenomenon of #10 (supposedly fixed since 2012) happens again. I'm running the current master branch, it started to appear some weeks ago.

Any time the application generates an exception, the toolbar blocks it and only shows

Fatal error: Uncaught TypeError: Argument 1 passed to ZendDeveloperTools\Exception\SerializableException::__construct() must be an instance of Exception, instance of Error given, called in /…/vendor/zendframework/zend-developer-tools/src/Collector/ExceptionCollector.php on line 45 and defined in /…/vendor/zendframework/zend-developer-tools/src/Exception/SerializableException.php:26 Stack trace:
#0 /…/vendor/zendframework/zend-developer-tools/src/Collector/ExceptionCollector.php(45): ZendDeveloperTools\Exception\SerializableException->__construct(Object(Error))
#1 /…/vendor/zendframework/zend-developer-tools/src/Profiler.php(210): ZendDeveloperTools\Collector\ExceptionCollector->collect(Object(Zend\Mvc\MvcEvent))
#2 /…/vendor/zendframework/zend-developer-tools/src/Listener/ProfilerListener.php(93): ZendDeveloperTools\Profiler->collect(Object(Zend\Mvc\MvcEvent))
#3 [ in /…/vendor/zendframework/zend-developer-tools/src/Exception/SerializableException.php on line 26
@andreaventuri
Copy link

andreaventuri commented Jun 30, 2016

I've got the same problem, I suggest to modify the argument type in the constructor from

public function __construct(\Exception $exception)

to

public function __construct(\Throwable $exception)

I use version 1.1.0

@samsonasik
Copy link
Contributor

there is no Throwable in php 5.6, maybe just remove the type hint ?

@Ocramius
Copy link
Member

Could also drop PHP 5.x :trollface:

But yeah, should be just dropping the type-hint if we want to support 5.x

samsonasik added a commit to samsonasik/ZendDeveloperTools that referenced this issue Jun 30, 2016
@samsonasik
Copy link
Contributor

@Ocramius I've create PR #217 for it.

@seaneble
Copy link
Author

seaneble commented Jul 4, 2016

Great, thanks! What are your release cycles? How long does it usually take to wrap this into a release?

@samsonasik
Copy link
Contributor

@Ocramius may know about that, but if you need the patch now, you can do the following update.

  • update dependency to:
"zendframework/zend-developer-tools": "dev-patch-3"
  • update repository url in composer.json:
"repositories" : [ {
    "type" : "vcs",
 "url" : "git@github.com:samsonasik/ZendDeveloperTools.git"
}]
  • composer update

@seaneble
Copy link
Author

seaneble commented Jul 5, 2016

Thanks, the fix works.

@seaneble seaneble closed this as completed Jul 5, 2016
weierophinney added a commit that referenced this issue Sep 8, 2016
Fixes #216 remove \Exception type hint
weierophinney added a commit that referenced this issue Sep 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants