Deal with settings read/write errors properly

This commit is contained in:
Graham Campbell
2018-12-28 13:56:53 +00:00
parent 5ffb5bc912
commit e764023ad8
8 changed files with 247 additions and 18 deletions

View File

@@ -11,6 +11,7 @@
namespace CachetHQ\Cachet\Http\Middleware;
use CachetHQ\Cachet\Settings\ReadException;
use CachetHQ\Cachet\Settings\Repository;
use Closure;
use Illuminate\Http\Request;
@@ -53,8 +54,12 @@ class SetupAlreadyCompleted
*/
public function handle(Request $request, Closure $next)
{
if ($this->settings->get('app_name')) {
return cachet_redirect('dashboard');
try {
if ($this->settings->get('app_name')) {
return cachet_redirect('dashboard');
}
} catch (ReadException $e) {
// not setup then!
}
return $next($request);