We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04a0f74 commit f906f30Copy full SHA for f906f30
src/Connect.php
@@ -47,9 +47,16 @@ private static function makeConnection()
47
} catch (PDOException $e) {
48
49
self::$response['status'] = 'error';
50
- self::$response['response'] = "cannot establish connection with the database.Check the provided credentials";
+ if($e->getCode()==2002){
51
+ self::$response['response'] = "Lost connection with the database.";
52
+ }
53
+ elseif($e->getCode()==1044 ||$e->getCode()==1045){
54
+ self::$response['response'] = "Incorrect database access credentials.";
55
+ }else{
56
+ self::$response['response'] = "Database access error.";
57
58
+
59
self::$response['code'] = $e->getCode();
- self::terminate(json_encode(self::$response));
60
}
61
62
0 commit comments