Logging for showblob

This commit is contained in:
David Bomba 2025-04-29 09:17:03 +10:00
parent 9b08972d64
commit cdb99be032
3 changed files with 30 additions and 3 deletions

View File

@ -210,7 +210,20 @@ class NinjaMailerJob implements ShouldQueue
}
} catch (\Exception $e) {
} catch(\ErrorException $e){
nlog("indeed i am a error exception NinjaMailerJob");
$message = "Attachment size is too large.";
$this->fail();
$this->logMailError($message, $this->company->clients()->first());
$this->entityEmailFailed($message);
$this->cleanUpMailers();
return;
}
catch (\Exception $e) {
nlog("Mailer failed with {$e->getMessage()}");
$message = $e->getMessage();

View File

@ -248,12 +248,14 @@ class Document extends BaseModel
}
try {
$file = base64_encode($image);
// $file = base64_encode($image);
$file = $image;
$img = new \Imagick(); //@phpstan-ignore-line
$img->readImageBlob($file);
$img->setImageCompression(true); //@phpstan-ignore-line
$img->setImageCompressionQuality(40);
$img->stripImage();
return $img->getImageBlob();
@ -265,6 +267,7 @@ class Document extends BaseModel
}
/**
* Returns boolean based on checks for image.
*

View File

@ -346,7 +346,18 @@ class Email implements ShouldQueue
$message = null;
}
} catch (\Exception | \RuntimeException $e) {
} catch(\ErrorException $e){
nlog("indeed i am a error exception Email Class");
$message = "Attachment size is too large.";
$this->fail();
$this->logMailError($message, $this->company->clients()->first());
$this->cleanUpMailers();
$this->entityEmailFailed($message);
return;
}
catch (\Exception | \RuntimeException $e) {
nlog("Mailer failed with {$e->getMessage()}");
$message = $e->getMessage();