-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mailer exception unification #13
Changes from 4 commits
e241540
90097d4
de13c6d
31695dc
628a81b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Nette Framework (http://nette.org) | ||
* Copyright (c) 2004 David Grudl (http://davidgrudl.com) | ||
*/ | ||
|
||
namespace Nette\Mail; | ||
|
||
use Nette; | ||
|
||
|
||
/** | ||
* Send failed exception. | ||
* | ||
* @author Jan Dvořák | ||
*/ | ||
class SendFailedException extends Nette\InvalidStateException | ||
{ | ||
} | ||
|
||
|
||
/** | ||
* SMTP mailer exception. | ||
* | ||
* @author David Grudl | ||
*/ | ||
class SmtpException extends SendFailedException | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dědíš to naopak, tohle je špatně, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, když teď nad tím tak přemýšlím, tak už chápu proč se to snaží udělat takhle... protože There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ale pak to nemůžeš poslat v SendMailMaileru a tím to ztrácí smysl, myslel jsem, že bych v SmtpMaileru dal taky tu vyjímku SendFailed ale bude to BC break There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tak udělej interface, něco jako class SmtpException extends \Exception {}
class SendmailException extends \Exception {}
interface SendFailedException {}
class SmtpSendFailedException extends \Exception implements SendFailedException {}
class SendmailSendFailedException extends \Exception implements SendFailedException {} (jenom nástřel, je potřeba to domyslet) |
||
{ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tohle nemá dědit od
InvalidStateException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Já vím, ale když to neudělám bude tam BC break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nebude
class SmtpException extends \Exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jak jsem psal, imho bude lepsi kdyz bude dedit - pro lepsi BC, ted nekdo u sendmail maileru treba chyta InvalidStateException ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ajo, sendmail háže
InvalidStateException
, tak pak okThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Připadá mi jako zbytečnost mít zvlášť exception pro každý mailer. Existuje pro to usecase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Já o žádným nevím, dělám to hlavně proto aby stačilo zachytáva jenom jednu vyjímku, ale kvůli BC stejně musí ta SmtpException zůstat, ne?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To jo, ale stačilo by přidat obecnou SendFailedException a SmtpException od ní podědit.