Jay Knight
Jay Knight
From what I can tell, `onError($callback)` just builds a list of things that get called if you call `$klein->error()`, and it doesn't actually have anything to do with handling exceptions....
klein includes a simple dependency injector (see `$app->register` in the docs). Instead of `$something = new App\Something($req, $res, $service, $app, $myParams);`, you could register something as a dependency: ``` $app->register("something",...
I don't think I ever did. After figuring out which exception was causing the problem, I fixed the error in my sql query and haven't had to deal with it...
Nevermind, I guess... I changed some things around and now throwing an error with ``` throw Klein\Exceptions\HttpException::createFromCode(404); ``` does invoke the httpError handler. That would probably be useful in the...
Instead of redirecting, it might be better to use $klein->abort(403), and set up a 403 block in the onHttpError handler: ``` $klein->with('/admin', function () use ($klein) { $klein->respond(function ($request, $response)...
This is related to #298, and I agree that I don't see a reason to catch uncaught exceptions at that level (that's what [`set_exception_handler`](https://secure.php.net/manual/en/function.set-exception-handler.php) is for).
Question: Do you prefer pull requests or issues in the moodle tracker for changes like this?
Tracker Issue: https://tracker.moodle.org/browse/CONTRIB-4087
That's fine, the more testing the better. Let me know if there's something that could be done better. I'd also like to work on the option uploading images in the...
Hey, has anything been done with this change? I just had to upload some new borders and was reminded that this change would be nice to have :)