Initial release

This commit is contained in:
Matias De lellis
2016-05-20 09:46:46 -03:00
commit 886605bc01
35 changed files with 2389 additions and 0 deletions

24
controller/errors.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
namespace OCA\QuickNotes\Controller;
use Closure;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCA\QuickNotes\Service\NotFoundException;
trait Errors {
protected function handleNotFound (Closure $callback) {
try {
return new DataResponse($callback());
} catch(NotFoundException $e) {
$message = ['message' => $e->getMessage()];
return new DataResponse($message, Http::STATUS_NOT_FOUND);
}
}
}