fix database connection issue

This commit is contained in:
raishvaria
2019-12-04 13:38:51 +05:30
parent b388e7a237
commit edc0e115e4
2 changed files with 12 additions and 18 deletions

View File

@ -49,20 +49,22 @@ class EnvironmentManager
'DB_PASSWORD='.$request->database_password."\n\n"; 'DB_PASSWORD='.$request->database_password."\n\n";
try { try {
if ($this->checkDatabaseConnection($request)) {
$this->checkDatabaseConnection($request);
if(\Schema::hasTable('users') ) { if(\Schema::hasTable('users') ) {
return [ return [
'error' => 'database_should_be_empty' 'error' => 'database_should_be_empty'
]; ];
} }
}
} catch (Exception $e) { } catch (Exception $e) {
return [ return [
'error' => $e->getMessage() 'error' => $e->getMessage()
]; ];
} }
try { try {
file_put_contents($this->envPath, str_replace( file_put_contents($this->envPath, str_replace(
@ -120,8 +122,6 @@ class EnvironmentManager
); );
} }
} catch (Exception $e) { } catch (Exception $e) {
return [ return [
'error' => 'mail_variables_save_error' 'error' => 'mail_variables_save_error'
@ -318,12 +318,6 @@ class EnvironmentManager
], ],
]); ]);
try { return DB::connection()->getPdo();
DB::connection()->getPdo();
return true;
} catch (Exception $e) {
return $e;
}
} }
} }

View File

@ -206,10 +206,10 @@ export default {
} else { } else {
window.toastr['error'](this.$t('wizard.errors.' + response.data.error)) window.toastr['error'](this.$t('wizard.errors.' + response.data.error))
} }
this.loading = false
} catch (e) { } catch (e) {
console.log(e.response)
window.toastr['error'](e.response.data.message) window.toastr['error'](e.response.data.message)
} finally {
this.loading = false
} }
} }
} }