Open Shaws-WD opened 3 years ago
You are passing $exception->getMessage()
by reference to another string and then logging the resulting string. I think you meant to concatenate $exception->getMessage()
.
Patch your code with this:
--- /tmp/a 2022-04-07 09:27:07.643822898 -0600
+++ /tmp/b 2022-04-07 09:27:29.883798919 -0600
@@ -16,9 +16,9 @@
log::debug('after Forrest::sobjects');
log::debug($response);
} catch (SalesforceException $exception) {
- $msg = 'SalesforceException exception:' & $exception->getMessage(); log::debug($msg); return;
+ $msg = 'SalesforceException exception:' . $exception->getMessage(); log::debug($msg); return;
} catch (Exception $exception) {
- $msg = 'non SalesforceException exception:' & $exception->getMessage(); log::debug($msg);return;
+ $msg = 'non SalesforceException exception:' . $exception->getMessage(); log::debug($msg);return;
}
$Forrest_success = $response['success'] ?? null;
if (!$Forrest_success) {
The one character bugs are the hardest to find!
Short version I am encountering a problem with Forrest v2.11 under Laravel 6.20.8 The problem occurs when the Forrest call
$response = Forrest::query($SOQL)
is embedded within a try/catch. An error results in execution halting without catching an exceptionMore details You can reproduce the error with the following code
Without the try/catch the call to Salesforce will fail with a logged error of
But with the try/catch the execution HALTS without catching an exception. Laravel logs a bizarre pair of lines which I have represented below (substituting hex character representation)
This resembles the error which I reported previously, but it is now after upgrade to latest version of Forrest and with better documentation of the error. The previous error was
failed exception handling when "The users password has expired" #261