J
Jon
Hello,
I am relatively new to the Java language and am working on a
communications API. This API will read and write to streams derived
from a socket. Naturally, there is the possibility that a socket
failure could occur. My API internally catches exceptions of type
IOException because this needs to change the state of my network
object. However, I also need to propogate the error back out to the
calling application. I am currently attempting to do so as shown
below:
try
{
...
}
catch(IOException e)
{
// do my own processing here
throw e;
}
My question is whether this is an appropriate use of exceptions and
whether it will have the intended consequences of propogating the
exception to the application?
Regards,
Jon Trauntvein
I am relatively new to the Java language and am working on a
communications API. This API will read and write to streams derived
from a socket. Naturally, there is the possibility that a socket
failure could occur. My API internally catches exceptions of type
IOException because this needs to change the state of my network
object. However, I also need to propogate the error back out to the
calling application. I am currently attempting to do so as shown
below:
try
{
...
}
catch(IOException e)
{
// do my own processing here
throw e;
}
My question is whether this is an appropriate use of exceptions and
whether it will have the intended consequences of propogating the
exception to the application?
Regards,
Jon Trauntvein