aboutsummaryrefslogtreecommitdiff
path: root/lib/response/errorresponse.php
blob: b72224f5a205607a5a4bf6ead721260518fb9379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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";
    }
}
?>