Jere,
You were right, you needed to do "throw new Exception..."
Good to hear you're working with the package. I'm actually working on a
new set of email classes -- ones that are designed better and do better
error checking. They should hopefully be out by Thursday. I'd encourage
you to download them and try them out!
Also, we apologize if anyone's been having problems with our site
(www.coolsevlets.com). Our service provider's servlet support has been
pretty spotty as of late....
--Bill
Jere Robinson wrote:
>
> ---------- Forwarded message ----------
> Date: Tue, 30 Mar 1999 15:40:20 -0500 (EST)
> From: Jere Robinson <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Throwing Exceptions problem.
>
> Hey guys, I'm trying to add a little bit of error detection and recovery
> to the coolservlets SmtpEmail class. When the class writes to the port, I
> try to catch the response, and if it's not what is expected, throw an
> exception and close out of the function. The trouble is, I throw
> Exception(String) and javac replies that 'Exception' is not found in
> SmtpEmail (compile time error).
>
> huh? Here is some code.. don't pick.. I'm at the start of my little java
> code life.
>
> public void send( )
> throws Exception, IOException
> {
> yadda yadda..
>
> if(errant("2",in))
> {
> error = "There was a problem with the RCPT TO response.";
> out.println( "QUIT" );
> out.close();
> throw Exception(error);
> return;
> }
>
> ..yadda yadda
> }
>
> The plan is to find out why this very nice package acts like it sent the
> mail, but then doesn't.
>
> Another compile time error is that all my returns
> are unreachable.. does throwing an exception kill the function that threw
> it?
>
> You can tell I'm a C++ student, can't you?
>
> Thanks,
> Jere
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
Bill Lynch -- [EMAIL PROTECTED] ----------------------
University of Iowa -- http://www.cs.uiowa.edu/~bmlynch
CoolServlets.com -- http://www.coolservlets.com
---------------------------------------------------------
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html