| | |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import com.sun.opends.sdk.util.LocalizableException; |
| | | import com.sun.opends.sdk.util.Message; |
| | | |
| | | |
| | | |
| | |
| | | public final class DecodeException extends IOException implements |
| | | LocalizableException |
| | | { |
| | | private final Message message; |
| | | private final LocalizableMessage message; |
| | | |
| | | private final boolean isFatal; |
| | | |
| | |
| | | * The message that explains the problem that occurred. |
| | | * @return The new fatal decode exception. |
| | | */ |
| | | public static DecodeException fatalError(Message message) |
| | | public static DecodeException fatalError(LocalizableMessage message) |
| | | { |
| | | return new DecodeException(message, true, null); |
| | | } |
| | |
| | | * The underlying cause of this exception. |
| | | * @return The new fatal decode exception. |
| | | */ |
| | | public static DecodeException fatalError(Message message, |
| | | public static DecodeException fatalError(LocalizableMessage message, |
| | | Throwable cause) |
| | | { |
| | | return new DecodeException(message, true, cause); |
| | |
| | | * The message that explains the problem that occurred. |
| | | * @return The new non-fatal decode exception. |
| | | */ |
| | | public static DecodeException error(Message message) |
| | | public static DecodeException error(LocalizableMessage message) |
| | | { |
| | | return new DecodeException(message, false, null); |
| | | } |
| | |
| | | * The underlying cause of this exception. |
| | | * @return The new non-fatal decode exception. |
| | | */ |
| | | public static DecodeException error(Message message, Throwable cause) |
| | | public static DecodeException error(LocalizableMessage message, Throwable cause) |
| | | { |
| | | return new DecodeException(message, false, cause); |
| | | } |
| | |
| | | |
| | | |
| | | // Construction is provided via factory methods. |
| | | private DecodeException(Message message, boolean isFatal, |
| | | private DecodeException(LocalizableMessage message, boolean isFatal, |
| | | Throwable cause) |
| | | { |
| | | super(message.toString(), cause); |
| | |
| | | /** |
| | | * Returns the message that explains the problem that occurred. |
| | | * |
| | | * @return Message of the problem |
| | | * @return LocalizableMessage of the problem |
| | | */ |
| | | public Message getMessageObject() |
| | | public LocalizableMessage getMessageObject() |
| | | { |
| | | return message; |
| | | } |