mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 05:31:10 -04:00 
			
		
		
		
	refactor database connection failed error message
This commit is contained in:
		| @ -48,19 +48,21 @@ class EnvironmentManager | ||||
|             'DB_USERNAME='.$request->database_username."\n". | ||||
|             'DB_PASSWORD='.$request->database_password."\n\n"; | ||||
|  | ||||
|         if (! $this->checkDatabaseConnection($request)) { | ||||
|  | ||||
|             return [ | ||||
|                 'error' => $this->checkDatabaseConnection($request) | ||||
|             ]; | ||||
|         } else { | ||||
|             if(\Schema::hasTable('users') ) { | ||||
|                 return [ | ||||
|                     'error' => 'database_should_be_empty' | ||||
|                 ]; | ||||
|         try { | ||||
|             if ($this->checkDatabaseConnection($request)) { | ||||
|                 if(\Schema::hasTable('users') ) { | ||||
|                     return [ | ||||
|                         'error' => 'database_should_be_empty' | ||||
|                     ]; | ||||
|                 } | ||||
|             } | ||||
|         } catch (Exception $e) { | ||||
|             return [ | ||||
|                 'error' => $e->getMessage() | ||||
|             ]; | ||||
|         } | ||||
|  | ||||
|  | ||||
|         try { | ||||
|  | ||||
|             file_put_contents($this->envPath, str_replace( | ||||
| @ -321,7 +323,7 @@ class EnvironmentManager | ||||
|  | ||||
|             return true; | ||||
|         } catch (Exception $e) { | ||||
|             return $e->getMessage(); | ||||
|             return $e; | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user