Fix for failed() method returning an error instead of exception

This commit is contained in:
David Bomba 2021-01-21 10:02:39 +11:00
parent 62bc55cf0b
commit 7d5b679214
9 changed files with 9 additions and 9 deletions

View File

@ -96,7 +96,7 @@ class ZipInvoices extends BaseMailerJob implements ShouldQueue
Mail::to($this->email)
->send(new DownloadInvoices(Storage::disk(config('filesystems.default'))->url($path.$file_name), $this->company));
} catch (\Exception $e) {
$this->failed($e);
// //$this->failed($e);
}
UnlinkFile::dispatch(config('filesystems.default'), $path.$file_name)->delay(now()->addHours(1));

View File

@ -96,7 +96,7 @@ class EntityFailedSendMailer extends BaseMailerJob implements ShouldQueue
->send(new EntityNotificationMailer($mail_obj));
} catch (\Exception $e) {
nlog("failing in EntityFailedSendMailer");
$this->failed($e);
//$this->failed($e);
$this->logMailError($e->getMessage(), $this->entity->client);
}
}

View File

@ -83,7 +83,7 @@ class EntityPaidMailer extends BaseMailerJob implements ShouldQueue
Mail::to($this->user->email)
->send(new EntityNotificationMailer($mail_obj));
} catch (\Exception $e) {
$this->failed($e);
// //$this->failed($e);
$this->logMailError($e->getMessage(), $this->payment->client);
}
}

View File

@ -90,7 +90,7 @@ class EntitySentMailer extends BaseMailerJob implements ShouldQueue
Mail::to($this->user->email)
->send(new EntityNotificationMailer($mail_obj));
} catch (\Exception $e) {
$this->failed($e);
// //$this->failed($e);
$this->logMailError($e->getMessage(), $this->entity->client);
}
}

View File

@ -88,7 +88,7 @@ class EntityViewedMailer extends BaseMailerJob implements ShouldQueue
Mail::to($this->user->email)
->send(new EntityNotificationMailer($mail_obj));
} catch (\Exception $e) {
$this->failed($e);
//$this->failed($e);
$this->logMailError($e->getMessage(), $this->entity->client);
}
}

View File

@ -73,7 +73,7 @@ class MailRouter extends BaseMailerJob implements ShouldQueue
Mail::to($this->to_user->email)
->send($this->mailable);
} catch (\Exception $e) {
$this->failed($e);
//$this->failed($e);
if ($this->to_user instanceof ClientContact) {
$this->logMailError($e->getMessage(), $this->to_user->client);

View File

@ -98,7 +98,7 @@ class PaymentFailureMailer extends BaseMailerJob implements ShouldQueue
Mail::to($company_user->user->email)
->send(new EntityNotificationMailer($mail_obj));
} catch (\Exception $e) {
$this->failed($e);
//$this->failed($e);
$this->logMailError($e->getMessage(), $this->client);
}
}

View File

@ -84,7 +84,7 @@ class EmailPayment extends BaseMailerJob implements ShouldQueue
} catch (\Exception $e) {
nlog("mailing failed with message " . $e->getMessage());
event(new PaymentWasEmailedAndFailed($this->payment, $this->company, Mail::failures(), Ninja::eventVars()));
$this->failed($e);
//$this->failed($e);
return $this->logMailError($e->getMessage(), $this->payment->client);
}

View File

@ -79,7 +79,7 @@ class UserEmailChanged extends BaseMailerJob implements ShouldQueue
Mail::to($this->new_email)
->send(new UserNotificationMailer($mail_obj));
} catch (\Exception $e) {
$this->failed($e);
//$this->failed($e);
$this->logMailError($e->getMessage(), $this->company->owner());
}
}