Enrich failed() log context with exception class and file:line

Previously logged only the exception message. Adds:
 - exception_class: distinguishes ClientException vs ConnectException
   vs other Guzzle/PHP failure types at a glance
 - file: file path and line where the exception was raised, useful
   for distinguishing 'failed inside Guzzle' from 'failed inside our
   code path'

The exception message itself often contains the GitHub API URL,
which encodes the app identifier. Capturing the specific appid at
the moment of failure would require touching handle() to track the
current iteration; left as a follow-up.
This commit is contained in:
Josh Salway
2026-04-22 17:01:18 +10:00
parent 5be7a65677
commit 98b6d96cd1
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -74,7 +74,9 @@ class ProcessApps implements ShouldQueue, ShouldBeUnique
public function failed(Throwable $exception): void
{
Log::error(static::class . ' permanently failed', [
'exception' => $exception->getMessage(),
'exception_class' => $exception::class,
'exception_message' => $exception->getMessage(),
'file' => $exception->getFile() . ':' . $exception->getLine(),
]);
}
}
+3 -1
View File
@@ -69,7 +69,9 @@ class UpdateApps implements ShouldQueue, ShouldBeUnique
Cache::lock('updateApps')->forceRelease();
Log::error(static::class . ' permanently failed', [
'exception' => $exception->getMessage(),
'exception_class' => $exception::class,
'exception_message' => $exception->getMessage(),
'file' => $exception->getFile() . ':' . $exception->getLine(),
]);
}
}