Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-02-02 19:58:44 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2018-02-12 13:01:08 +0300
commit6012a5675e47dfe246496b6e5dd897492b11d3ad (patch)
treebe4a39f31a9caf9b74f52ca5eef5f04a1fab4859 /lib/AppInfo
parentee4bb5471dfd6c5fe61b64793f26b3af05f06f00 (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.php4
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');
}
}