代码注释(真

main
jacky-qiao 8 months ago
parent a4caade656
commit afe5b77cb2

@ -14,20 +14,27 @@
* limitations under the License. * limitations under the License.
*/ */
package net.micode.notes.gtask.exception; package net.micode.notes.gtask.exception; // 定义该类所在的包
/**
* ActionFailureException
*
*/
public class ActionFailureException extends RuntimeException { public class ActionFailureException extends RuntimeException {
private static final long serialVersionUID = 4425249765923293627L; private static final long serialVersionUID = 4425249765923293627L; // 序列化版本UID用于序列化机制
// 默认构造函数
public ActionFailureException() { public ActionFailureException() {
super(); super(); // 调用父类的构造函数
} }
// 带有错误信息的构造函数
public ActionFailureException(String paramString) { public ActionFailureException(String paramString) {
super(paramString); super(paramString); // 调用父类构造函数,传递错误信息
} }
// 带有错误信息和根本原因的构造函数
public ActionFailureException(String paramString, Throwable paramThrowable) { public ActionFailureException(String paramString, Throwable paramThrowable) {
super(paramString, paramThrowable); super(paramString, paramThrowable); // 调用父类构造函数,传递错误信息和原因
} }
} }

@ -14,20 +14,28 @@
* limitations under the License. * limitations under the License.
*/ */
package net.micode.notes.gtask.exception; package net.micode.notes.gtask.exception; // 定义包路径
/**
* NetworkFailureException
*
*/
public class NetworkFailureException extends Exception { public class NetworkFailureException extends Exception {
// 序列版本UID用于序列化
private static final long serialVersionUID = 2107610287180234136L; private static final long serialVersionUID = 2107610287180234136L;
// 默认构造函数
public NetworkFailureException() { public NetworkFailureException() {
super(); super(); // 调用父类的构造函数
} }
// 带有消息的构造函数
public NetworkFailureException(String paramString) { public NetworkFailureException(String paramString) {
super(paramString); super(paramString); // 调用父类的构造函数,传入异常消息
} }
// 带有消息和原因的构造函数
public NetworkFailureException(String paramString, Throwable paramThrowable) { public NetworkFailureException(String paramString, Throwable paramThrowable) {
super(paramString, paramThrowable); super(paramString, paramThrowable); // 调用父类的构造函数,传入异常消息和原因
} }
} }

Loading…
Cancel
Save