Improve error handling in API.

This commit is contained in:
James Cole
2019-10-30 20:02:21 +01:00
parent bed182cf13
commit 9a028d5002
18 changed files with 131 additions and 103 deletions

View File

@@ -57,7 +57,7 @@ class ConfigurationController extends Controller
$admin = auth()->user();
if (!$this->repository->hasRole($admin, 'owner')) {
throw new FireflyException(trans('api.error_no_access')); // @codeCoverageIgnore
throw new FireflyException('200005: You need the "owner" role to do this.'); // @codeCoverageIgnore
}
return $next($request);