Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better debugging in exception throwing :)

  • Loading branch information...
commit 1ace09fc95b057e3ae17710ec1bbf9153c5f3c64 1 parent c8bdc40
@JonTheNiceGuy JonTheNiceGuy authored
Showing with 38 additions and 1 deletion.
  1. +38 −1 classes/Glue/Gammu.php
View
39 classes/Glue/Gammu.php
@@ -125,7 +125,44 @@ public function __construct($arrConfigValues = array())
|| ($DBType != 'sqlite' && $DBPass == null)
|| ($DBType != 'sqlite' && $DBBase == null)
) {
- throw new InvalidArgumentException("Insufficient detail to connect to Gammu Database");
+ $value = "\r\nDBType: $DBType (";
+ if ($DBType == null) {
+ $value .= "False";
+ } else {
+ $value .= "True";
+ }
+ $value .= ")\r\nDBHost: $DBHost (";
+ if ($DBHost == null) {
+ $value .= "False";
+ } else {
+ $value .= "True";
+ }
+ $value .= ")\r\nDBPort: $DBPort (";
+ if ($DBPort == null) {
+ $value .= "False";
+ } else {
+ $value .= "True";
+ }
+ $value .= ")\r\nDBUser: $DBUser (";
+ if ($DBUser == null) {
+ $value .= "False";
+ } else {
+ $value .= "True";
+ }
+ $value .= ")\r\nDBPass: $DBPass (";
+ if ($DBPass == null) {
+ $value .= "False";
+ } else {
+ $value .= "True";
+ }
+ $value .= ")\r\nDBBase: $DBBase (";
+ if ($DBBase == null) {
+ $value .= "False";
+ } else {
+ $value .= "True";
+ }
+ $value .= ")";
+ throw new InvalidArgumentException("Insufficient detail to connect to Gammu Database : $value");
}
$this->strInterface = $GluePrefix;
Please sign in to comment.
Something went wrong with that request. Please try again.