Skip to content

Commit a335ea3

Browse files
authored
Added call-to action to open the error in Horizon (#84)
1 parent f4722c5 commit a335ea3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Notification.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@ public function getEvent(): JobFailed
3131

3232
public function toMail($notifiable): MailMessage
3333
{
34-
return (new MailMessage())
34+
return (new MailMessage)
3535
->error()
3636
->subject('A job failed at '.config('app.url'))
3737
->line("Exception message: {$this->event->exception->getMessage()}")
3838
->line("Job class: {$this->event->job->resolveName()}")
3939
->line("Job body: {$this->event->job->getRawBody()}")
40-
->line("Exception: {$this->event->exception->getTraceAsString()}");
40+
->line("Exception: {$this->event->exception->getTraceAsString()}")
41+
->action('View Error', url(config('horizon.path').'/failed/'.$this->event->job->getJobId()));
4142
}
4243

4344
public function toSlack(): SlackMessage
4445
{
45-
return (new SlackMessage())
46+
return (new SlackMessage)
4647
->error()
4748
->content('A job failed at '.config('app.url'))
4849
->attachment(function (SlackAttachment $attachment) {

0 commit comments

Comments
 (0)