Catch QueryException incase we're not setup. Closes #383

This commit is contained in:
James Brooks
2015-01-15 13:35:03 +00:00
parent 4b280dfc05
commit e8a9035490

View File

@@ -3,6 +3,7 @@
namespace CachetHQ\Cachet\Providers;
use CachetHQ\Cachet\Models\Setting;
use Illuminate\Database\QueryException;
use Illuminate\Support\ServiceProvider;
class LoadConfigServiceProvider extends ServiceProvider
@@ -14,10 +15,16 @@ class LoadConfigServiceProvider extends ServiceProvider
*/
public function boot()
{
// Get app custom configuration.
$appDomain = Setting::get('app_domain');
$appTimezone = Setting::get('app_timezone');
$appLocale = Setting::get('app_locale');
$appDomain = $appTimezone = $appLocale = null;
try {
// Get app custom configuration.
$appDomain = Setting::get('app_domain');
$appTimezone = Setting::get('app_timezone');
$appLocale = Setting::get('app_locale');
} catch (QueryException $e) {
// Don't throw any errors, we may not be setup yet.
}
// Override default app values.
$this->app->config->set('app.url', $appDomain ?: $this->app->config->get('app.url'));