slimphp / Slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
http://slimframework.com
MIT License
11.94k stars 1.95k forks source link

Slim v2 unknown exception #1406

Closed r3wt closed 9 years ago

r3wt commented 9 years ago

$e->getMessage() outputs ``

$e->getFile() outputs /vendor/slim/slim/Slim/Slim.php

$e->getLine outputs 1057

path is

/api/create_single

route is:

$app->map('/api/:method',function($method){
    (new \StarterKit\Routes\API)->__try($method);
})->via('GET','POST');

Unsure what the problem is. its a simple form submit with a couple of file inputs. controller pattern is battle tested and working. unsure of this error reason.

JoeBengalen commented 9 years ago

Should be a Slim\Exception\Pass

https://github.com/slimphp/Slim/blob/2.x/Slim/Slim.php#L1057

geggleto commented 9 years ago

I can't reproduce it. Slim uses Exceptions to control the flow, which is just a quirk of slim 2.

r3wt commented 9 years ago

@geggleto there are no usage of slim's pass inside of the controller, which is why i'm here. first thing i did was consult the source.

r3wt commented 9 years ago

could slim be running out of memory? i'm literally baffled.

akrabat commented 9 years ago

What is the type of the Exception?

akrabat commented 9 years ago

Also, $e->getTraceAsString() should show you the backtrace…

r3wt commented 9 years ago

Oh my god, i need to go to sleep. it was a damn typo, referencing a function that doesn't exist on controller, which propagated to my app, which propagated all the way back to slim

akrabat commented 9 years ago

Glad you found it!