summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib/Controller/AWorkflowController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/workflowengine/lib/Controller/AWorkflowController.php')
-rw-r--r--apps/workflowengine/lib/Controller/AWorkflowController.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/workflowengine/lib/Controller/AWorkflowController.php b/apps/workflowengine/lib/Controller/AWorkflowController.php
index 8b0d35ef62e..20e4f74d3c4 100644
--- a/apps/workflowengine/lib/Controller/AWorkflowController.php
+++ b/apps/workflowengine/lib/Controller/AWorkflowController.php
@@ -34,20 +34,26 @@ use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCS\OCSForbiddenException;
use OCP\AppFramework\OCSController;
use OCP\IRequest;
+use Psr\Log\LoggerInterface;
abstract class AWorkflowController extends OCSController {
/** @var Manager */
protected $manager;
+ /** @var LoggerInterface */
+ private $logger;
+
public function __construct(
$appName,
IRequest $request,
- Manager $manager
+ Manager $manager,
+ LoggerInterface $logger
) {
parent::__construct($appName, $request);
$this->manager = $manager;
+ $this->logger = $logger;
}
/**
@@ -113,6 +119,7 @@ abstract class AWorkflowController extends OCSController {
} catch (\DomainException $e) {
throw new OCSForbiddenException($e->getMessage(), $e);
} catch (Exception $e) {
+ $this->logger->error('Error when inserting flow', ['exception' => $e]);
throw new OCSException('An internal error occurred', $e->getCode(), $e);
}
}
@@ -140,6 +147,7 @@ abstract class AWorkflowController extends OCSController {
} catch (\DomainException $e) {
throw new OCSForbiddenException($e->getMessage(), $e);
} catch (Exception $e) {
+ $this->logger->error('Error when updating flow with id ' . $id, ['exception' => $e]);
throw new OCSException('An internal error occurred', $e->getCode(), $e);
}
}
@@ -158,6 +166,7 @@ abstract class AWorkflowController extends OCSController {
} catch (\DomainException $e) {
throw new OCSForbiddenException($e->getMessage(), $e);
} catch (Exception $e) {
+ $this->logger->error('Error when deleting flow with id ' . $id, ['exception' => $e]);
throw new OCSException('An internal error occurred', $e->getCode(), $e);
}
}