-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from vnobo/dev
Dev
- Loading branch information
Showing
26 changed files
with
345 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 31 additions & 2 deletions
33
boot/platform/src/main/java/com/plate/boot/commons/exception/QueryException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,44 @@ | ||
package com.plate.boot.commons.exception; | ||
|
||
/** | ||
* @author <a href="https://github.com/vnobo">Alex Bob</a> | ||
* Custom exception class for handling query-related errors. | ||
* Extends the RestServerException to provide additional context for query errors. | ||
* | ||
* <p>Example usage:</p> | ||
* <pre> | ||
* {@code | ||
* try { | ||
* // some query logic | ||
* } catch (Exception e) { | ||
* throw QueryException.withError("Error executing query", e); | ||
* } | ||
* } | ||
* </pre> | ||
* | ||
* <p>This class provides a static method to create instances of QueryException with a specific error message and cause.</p> | ||
* | ||
* <p>Author: <a href="https://github.com/vnobo">Alex Bob</a></p> | ||
*/ | ||
public class QueryException extends RestServerException { | ||
|
||
/** | ||
* Constructs a new QueryException with the specified detail message and cause. | ||
* | ||
* @param message the detail message (which is saved for later retrieval by the {@link Throwable#getMessage()} method). | ||
* @param throwable the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). | ||
*/ | ||
public QueryException(String message, Throwable throwable) { | ||
super(message, throwable); | ||
} | ||
|
||
/** | ||
* Creates a new QueryException with the specified detail message and cause. | ||
* | ||
* @param message the detail message. | ||
* @param throwable the cause. | ||
* @return a new instance of QueryException. | ||
*/ | ||
public static QueryException withError(String message, Throwable throwable) { | ||
return new QueryException(message, throwable); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.