Files
DatBrowser/app/Notification/NotificationBody/JobErrorNotificationBody.php
Matthias Guillitte 6a95653c52
All checks were successful
Push image to registry / build-image (push) Successful in 5m20s
Added notification on job fail
2025-03-01 15:12:15 +01:00

32 lines
762 B
PHP

<?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;
}
}