aboutsummaryrefslogtreecommitdiff
path: root/lib/response/errorresponse.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/response/errorresponse.php')
-rw-r--r--lib/response/errorresponse.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/response/errorresponse.php b/lib/response/errorresponse.php
new file mode 100644
index 0000000..b72224f
--- /dev/null
+++ b/lib/response/errorresponse.php
@@ -0,0 +1,20 @@
+<?php
+namespace OCA\Grauphel\Lib\Response;
+
+class ErrorResponse extends \OCP\AppFramework\Http\Response
+{
+ protected $error;
+
+ public function __construct($error)
+ {
+ $this->setStatus(\OCP\AppFramework\Http::STATUS_BAD_REQUEST);
+ $this->addHeader('Content-Type', 'text/plain; charset=utf-8');
+ $this->error = $error;
+ }
+
+ public function render()
+ {
+ return $this->error . "\n";
+ }
+}
+?>