Package org.onebusaway.exceptions
Class ServiceException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.onebusaway.exceptions.ServiceException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InvalidArgumentServiceException
,InvalidSelectionServiceException
,NoSuchRouteServiceException
,NoSuchServicePatternServiceException
,NoSuchStopServiceException
,NoSuchTripServiceException
,ServiceAreaServiceException
public class ServiceException extends RuntimeException
A base exception type that is used by many OneBusAway service methods. I decided to make this base exception a sub-class ofRuntimeException
, which means that you do no have to explicitly wrap calls to methods that throwServiceException
with catch or with throws. There is a lot of debate about that behavior in the Java community. Generally speaking, if errors are non-recoverable, the convention is to make them a runtime exception. However, there are definitely a number of uses ofServiceException
and its subclasses that are recoverable. Perhaps some refactoring is in order?- Author:
- bdferris
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServiceException()
ServiceException(String message)
ServiceException(String message, Throwable ex)
ServiceException(Throwable ex)
-
Method Summary
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-