Added notification on job fail
All checks were successful
Push image to registry / build-image (push) Successful in 5m20s
All checks were successful
Push image to registry / build-image (push) Successful in 5m20s
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\NotificationBody;
|
||||
|
||||
use App\Models\Job;
|
||||
use App\Notification\NotificationBody;
|
||||
use App\Notification\Stringifiable;
|
||||
|
||||
class JobErrorNotificationBody extends NotificationBody {
|
||||
|
||||
private Job $job;
|
||||
private string $error;
|
||||
|
||||
public function __construct(Job $job, $error) {
|
||||
$this->job = $job;
|
||||
$this->error = $error;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toMarkdownString(): string {
|
||||
return "Le job \"{$this->job->name}\" a échoué avec l'erreur :\n ```" . $this->error . "``` \nScreenshot : ";
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toString(): string {
|
||||
return "Le job \"{$this->job->name}\" a échoué avec l'erreur :\n " . $this->error;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user