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.
xiaomi-Notes/ActionFailureException.java

87 lines
4.6 KiB

3 months ago
/*
* 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.
*/
/*
`ActionFailureException` Java `RuntimeException`
`net.micode.notes.gtask.exception`
*/
// **包声明和导入**
package net.micode.notes.gtask.exception;
//这行代码定义了该类所在的包名:`net.micode.notes.gtask.exception`。通常包用于组织类和接口,并为类提供命名空间。
//**类声明**
public class ActionFailureException extends RuntimeException {
//`ActionFailureException` 继承自 `RuntimeException`,意味着它是一个 **未检查异常unchecked exception**。
// `RuntimeException` 是 `Exception` 类的子类,通常用于表示程序中的错误,通常不需要强制捕获或声明。
//- 异常的名字 `ActionFailureException` 表示某种操作失败的情况。
//**序列化 ID**
private static final long serialVersionUID = 4425249765923293627L;
/*
`serialVersionUID`
- Java `Serializable` `serialVersionUID`
- `ActionFailureException` `Serializable`
*/
//**构造函数**
// 默认构造函数
public ActionFailureException() {
super();
}
// 默认构造函数,调用 `RuntimeException` 的无参构造函数,表示没有具体的错误信息时抛出此异常。
//带消息构造函数
public ActionFailureException(String paramString) {
super(paramString);
}
//- 这个构造函数允许传入一个字符串参数 `paramString`,用来描述异常的具体信息。这会调用 `RuntimeException` 的带有消息的构造函数。
//带消息和原因构造函数
public ActionFailureException(String paramString, Throwable paramThrowable) {
super(paramString, paramThrowable);
}
//- 这个构造函数允许传入一个字符串参数和另一个异常(`Throwable`)作为参数。
// 通过这种方式,可以指定异常的描述信息和导致当前异常的根本原因(例如,另一个异常)。
/* . ** `RuntimeException` **
- `ActionFailureException` `RuntimeException` **unchecked exception**
-
**使**
`ActionFailureException`
- `ActionFailureException`
-
`ActionFailureException` `RuntimeException`
-
- `RuntimeException`
*/