change $message to $errorMessage to be more precise
This commit is contained in:
parent
10c10fc95c
commit
2aee8ca2d9
3 changed files with 29 additions and 20 deletions
9
CRM/TwingleCampaign/BAO/OptionValue.php
Normal file
9
CRM/TwingleCampaign/BAO/OptionValue.php
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace CRM\TwingleCampaign\BAO;
|
||||||
|
|
||||||
|
|
||||||
|
class OptionValue {
|
||||||
|
|
||||||
|
}
|
|
@ -71,11 +71,11 @@ class TwingleEvent extends Campaign {
|
||||||
self::TWINGLE
|
self::TWINGLE
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$message = $e->getMessage();
|
$errorMessage = $e->getMessage();
|
||||||
|
|
||||||
// Log Exception
|
// Log Exception
|
||||||
Civi::log()->error(
|
Civi::log()->error(
|
||||||
"Failed to instantiate TwingleEvent: $message"
|
"Failed to instantiate TwingleEvent: $errorMessage"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
|
@ -84,7 +84,7 @@ class TwingleEvent extends Campaign {
|
||||||
"event_id" => (int) $values['id'],
|
"event_id" => (int) $values['id'],
|
||||||
"project_id" => (int) $values['project_id'],
|
"project_id" => (int) $values['project_id'],
|
||||||
"status" =>
|
"status" =>
|
||||||
"Failed to instantiate TwingleEvent: $message",
|
"Failed to instantiate TwingleEvent: $errorMessage",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,11 +95,11 @@ class TwingleEvent extends Campaign {
|
||||||
try {
|
try {
|
||||||
$result = $event->create($is_test);
|
$result = $event->create($is_test);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$message = $e->getMessage();
|
$errorMessage = $e->getMessage();
|
||||||
|
|
||||||
// Log Exception
|
// Log Exception
|
||||||
Civi::log()->error(
|
Civi::log()->error(
|
||||||
"Could not create campaign from TwingleEvent: $message"
|
"Could not create campaign from TwingleEvent: $errorMessage"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
|
@ -108,7 +108,7 @@ class TwingleEvent extends Campaign {
|
||||||
"event_id" => (int) $values['id'],
|
"event_id" => (int) $values['id'],
|
||||||
"project_id" => (int) $values['project_id'],
|
"project_id" => (int) $values['project_id'],
|
||||||
"status" =>
|
"status" =>
|
||||||
"Could not create campaign from TwingleEvent: $message",
|
"Could not create campaign from TwingleEvent: $errorMessage",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,15 +125,15 @@ class TwingleEvent extends Campaign {
|
||||||
? 'TwingleEvent updated'
|
? 'TwingleEvent updated'
|
||||||
: 'TwingleEvent Update failed';
|
: 'TwingleEvent Update failed';
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$message = $e->getMessage();
|
$errorMessage = $e->getMessage();
|
||||||
|
|
||||||
// Log Exception
|
// Log Exception
|
||||||
Civi::log()->error(
|
Civi::log()->error(
|
||||||
"Could not update TwingleEvent campaign: $message"
|
"Could not update TwingleEvent campaign: $errorMessage"
|
||||||
);
|
);
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
$result = $event->getResponse(
|
$result = $event->getResponse(
|
||||||
"Could not update TwingleEvent campaign: $message"
|
"Could not update TwingleEvent campaign: $errorMessage"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,9 +358,9 @@ class TwingleEvent extends Campaign {
|
||||||
]);
|
]);
|
||||||
return (int) $contact['id'];
|
return (int) $contact['id'];
|
||||||
} catch (CiviCRM_API3_Exception $e) {
|
} catch (CiviCRM_API3_Exception $e) {
|
||||||
$message = $e->getMessage();
|
$errorMessage = $e->getMessage();
|
||||||
\Civi::log()->error("TwingleCampaign extension could not match or create a contact for:
|
\Civi::log()->error("TwingleCampaign extension could not match or create a contact for:
|
||||||
$names $lastname $email./nError Message: $message");
|
$names $lastname $email./nError Message: $errorMessage");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,11 +71,11 @@ class TwingleProject extends Campaign {
|
||||||
self::TWINGLE
|
self::TWINGLE
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$message = $e->getMessage();
|
$errorMessage = $e->getMessage();
|
||||||
|
|
||||||
// Log Exception
|
// Log Exception
|
||||||
Civi::log()->error(
|
Civi::log()->error(
|
||||||
"Failed to instantiate TwingleProject: $message"
|
"Failed to instantiate TwingleProject: $errorMessage"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
|
@ -83,7 +83,7 @@ class TwingleProject extends Campaign {
|
||||||
"title" => $values['name'],
|
"title" => $values['name'],
|
||||||
"project_id" => (int) $values['id'],
|
"project_id" => (int) $values['id'],
|
||||||
"status" =>
|
"status" =>
|
||||||
"Failed to instantiate TwingleProject: $message",
|
"Failed to instantiate TwingleProject: $errorMessage",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,11 +97,11 @@ class TwingleProject extends Campaign {
|
||||||
);
|
);
|
||||||
$result = $project->create($is_test);
|
$result = $project->create($is_test);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$message = $e->getMessage();
|
$errorMessage = $e->getMessage();
|
||||||
|
|
||||||
// Log Exception
|
// Log Exception
|
||||||
Civi::log()->error(
|
Civi::log()->error(
|
||||||
"Could not create campaign from TwingleProject: $message"
|
"Could not create campaign from TwingleProject: $errorMessage"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
|
@ -109,7 +109,7 @@ class TwingleProject extends Campaign {
|
||||||
"title" => $values['name'],
|
"title" => $values['name'],
|
||||||
"project_id" => (int) $values['id'],
|
"project_id" => (int) $values['id'],
|
||||||
"status" =>
|
"status" =>
|
||||||
"Could not create campaign from TwingleProject: $message",
|
"Could not create campaign from TwingleProject: $errorMessage",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,15 +129,15 @@ class TwingleProject extends Campaign {
|
||||||
? 'TwingleProject updated'
|
? 'TwingleProject updated'
|
||||||
: 'TwingleProject Update failed';
|
: 'TwingleProject Update failed';
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$message = $e->getMessage();
|
$errorMessage = $e->getMessage();
|
||||||
|
|
||||||
// Log Exception
|
// Log Exception
|
||||||
Civi::log()->error(
|
Civi::log()->error(
|
||||||
"Could not update TwingleProject campaign: $message"
|
"Could not update TwingleProject campaign: $errorMessage"
|
||||||
);
|
);
|
||||||
// Return result array with error description
|
// Return result array with error description
|
||||||
$result = $project->getResponse(
|
$result = $project->getResponse(
|
||||||
"Could not update TwingleProject campaign: $message"
|
"Could not update TwingleProject campaign: $errorMessage"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue