Error handling: What options do you need? #170
Replies: 4 comments 3 replies
-
That would already be a good configurable option... :) Other options could include:
Also I'd like it to respect the |
Beta Was this translation helpful? Give feedback.
-
Small progress update 1 now that PR #173 has been merged 🎉 This changeset makes the existing <?php
require __DIR__ . '/../vendor/autoload.php';
$app = new FrameworkX\App(
new FrameworkX\ErrorHandler()
);
// Register routes here, see routing…
$app->run(); This is a starting point to add more options to control error handling in follow-up PRs as discussed here. |
Beta Was this translation helpful? Give feedback.
-
Small progress update 2 now that PR #175 has been merged 🎉 This changeset adds support for loading the <?php
require __DIR__ . '/../vendor/autoload.php';
$app = new FrameworkX\App(
FrameworkX\AccessLogHandler::class,
FrameworkX\ErrorHandler::class
);
// Register routes here, see routing…
$app->run(); On top of this, you may now configure the default handlers with an explicit DI container configuration like this: <?php
require __DIR__ . '/../vendor/autoload.php';
$container = new FrameworkX\Container([
FrameworkX\ErrorHandler::class => fn () => new FrameworkX\ErrorHandler()
]);
$app = new FrameworkX\App($container);
// Register routes here, see routing…
$app->run(); This is the next step in adding more options to control access logging and error handling in follow-up PRs as discussed here. |
Beta Was this translation helpful? Give feedback.
-
WHat I would find useful is a way to set my own |
Beta Was this translation helpful? Give feedback.
-
One of our current idea is to make the
ErrorHandler
configurable. During discussion a few questions came up: What should be configurable options for this and what should be defaults for each option? Additionally should thisErrorHandler
only being called forExceptions
or also for HTTP client/server error responses?@clue and I are curious what you think about this topic!
Beta Was this translation helpful? Give feedback.
All reactions