diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-02-02 19:58:44 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-02-12 13:01:08 +0300 |
commit | 6012a5675e47dfe246496b6e5dd897492b11d3ad (patch) | |
tree | be4a39f31a9caf9b74f52ca5eef5f04a1fab4859 /lib/AppInfo | |
parent | ee4bb5471dfd6c5fe61b64793f26b3af05f06f00 (diff) |
Add API error wrapper middleware to API routes
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/AppInfo')
-rw-r--r-- | lib/AppInfo/Application.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 15229fab6..dc2f4fbd8 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -27,6 +27,7 @@ use OCA\Mail\Contracts\IAvatarService; use OCA\Mail\Contracts\IMailManager; use OCA\Mail\Contracts\IMailTransmission; use OCA\Mail\Contracts\IUserPreferences; +use OCA\Mail\Http\Middleware\ErrorMiddleware; use OCA\Mail\Service\Attachment\AttachmentService; use OCA\Mail\Service\AvatarService; use OCA\Mail\Service\MailManager; @@ -67,6 +68,9 @@ class Application extends App { $container->registerParameter("testSmtp", $testSmtp); $container->registerParameter("referrer", isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null); $container->registerParameter("hostname", Util::getServerHostName()); + + $container->registerAlias('ErrorMiddleware', ErrorMiddleware::class); + $container->registerMiddleWare('ErrorMiddleware'); } } |