diff options
author | Emil Ivov <emcho@jitsi.org> | 2006-10-23 16:21:20 +0000 |
---|---|---|
committer | Emil Ivov <emcho@jitsi.org> | 2006-10-23 16:21:20 +0000 |
commit | b6efcbbdd43cff8badda1ff2251b08ef07db98ee (patch) | |
tree | 1b44ea10e5fc62daed7e77dc36cde33a00aa906a /src/net/java/sip/communicator/service/media/MediaException.java | |
parent | 34e03841fec1157752a3ba763c8a40ae830de821 (diff) | |
download | jitsi-b6efcbbdd43cff8badda1ff2251b08ef07db98ee.zip jitsi-b6efcbbdd43cff8badda1ff2251b08ef07db98ee.tar.gz jitsi-b6efcbbdd43cff8badda1ff2251b08ef07db98ee.tar.bz2 |
Working on the JMF implementation of the media service.
Added class for media specific exceptions.
Diffstat (limited to 'src/net/java/sip/communicator/service/media/MediaException.java')
-rw-r--r-- | src/net/java/sip/communicator/service/media/MediaException.java | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/service/media/MediaException.java b/src/net/java/sip/communicator/service/media/MediaException.java new file mode 100644 index 0000000..8d23f5b --- /dev/null +++ b/src/net/java/sip/communicator/service/media/MediaException.java @@ -0,0 +1,86 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.service.media; + +/** + * Thrown when errors occur in the media package. + * + * @author Emil Ivov + */ +public class MediaException + extends Exception +{ + /** + * Set when no other error code can describe the exception that occurred. + */ + public static final int GENERAL_ERROR = 1; + + /** + * Set when command fails due to a failure in network communications or + * a transport error. + */ + public static final int NETWORK_ERROR = 2; + + /** + * Set to indicate that the service implementation needs to be started + * (initialized) before calling the method that threw the exception. + */ + public static final int SERVICE_NOT_STARTED = 3; + + /** + * Set when an operation fails for implementation specific reasons. + */ + public static final int INTERNAL_ERROR = 4; + + /** + * Set when an operation fails because of an input/output error. + */ + public static final int IO_ERROR = 4; + + /** + * The error code of the exception + */ + private int errorCode = GENERAL_ERROR; + + + /** + * Creates an exception with the specified error message and error code. + * @param message A message containing details on the error that caused the + * exception + * @param errorCode the error code of the exception (one of the error code + * fields of this class) + */ + public MediaException(String message, int errorCode) + { + super(message); + this.errorCode = errorCode; + } + + /** + * Creates an exception with the specified message, errorCode and cause. + * @param message A message containing details on the error that caused the + * exception + * @param errorCode the error code of the exception (one of the error code + * fields of this class) + * @param cause the error that caused this exception + */ + public MediaException(String message, int errorCode, Throwable cause) + { + super(message, cause); + this.errorCode = errorCode; + } + + /** + * Obtain the error code value. + * + * @return the error code for the exception. + */ + public int getErrorCode() + { + return errorCode; + } +} |