Skip to content

bug fix: formatting exception so it can be saved to the database. #1480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/Jenssegers/Mongodb/Queue/Failed/MongoFailedJobProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@

use Carbon\Carbon;
use Illuminate\Queue\Failed\DatabaseFailedJobProvider;
use Exception;

class MongoFailedJobProvider extends DatabaseFailedJobProvider
{
/**
* Log a failed job into storage.
* @param string $connection
* @param string $queue
* @param string $payload
*
* @param string $connection
* @param string $queue
* @param string $payload
* @param Exception $exception
*
* @return void
*/
public function log($connection, $queue, $payload, $exception)
{
$failed_at = Carbon::now()->getTimestamp();

$exception = [
'Message: ' => $exception->getMessage(),
'Stack Trace: ' => $exception->getTrace()
];

$this->getTable()->insert(compact('connection', 'queue', 'payload', 'failed_at', 'exception'));
}

Expand Down