You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
text123/NetworkFailureException.java

49 lines
2.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// 声明该类所属的包
package net.micode.notes.gtask.exception;
// 定义一个名为NetworkFailureException的异常类它继承自Exception类
// 这意味着它是一个受检查异常,在方法中抛出时需要进行显式的异常处理
public class NetworkFailureException extends Exception {
// 序列化版本号,用于在反序列化过程中验证序列化对象的版本兼容性
// 确保不同版本的类在反序列化时能够正确识别和处理
private static final long serialVersionUID = 2107610287180234136L;
// 无参构造函数
// 创建一个没有具体错误信息的NetworkFailureException对象
public NetworkFailureException() {
// 调用父类Exception的无参构造函数
super();
}
// 带有一个字符串参数的构造函数
// 创建一个包含特定错误信息的NetworkFailureException对象
public NetworkFailureException(String paramString) {
// 调用父类Exception的带有一个字符串参数的构造函数
// 该字符串将作为异常的错误信息
super(paramString);
}
// 带有一个字符串参数和一个Throwable对象的构造函数
// 创建一个既包含特定错误信息又包含导致该异常的原始异常的NetworkFailureException对象
public NetworkFailureException(String paramString, Throwable paramThrowable) {
// 调用父类Exception的带有一个字符串和一个Throwable参数的构造函数
// 字符串作为异常的错误信息Throwable对象表示原始异常
super(paramString, paramThrowable);
}
}