diff options
| author | doufenghu <[email protected]> | 2023-10-22 22:11:18 +0800 |
|---|---|---|
| committer | doufenghu <[email protected]> | 2023-10-22 22:11:18 +0800 |
| commit | 4448d5313681175c9c6a7868550d4a677ed3a4f0 (patch) | |
| tree | bc6a4202c85593befaeb24cd8cfa7caf4cbc0908 /docs | |
| parent | 5300fb6fb4eba9d0d2b88945dfad8a16e6b55f24 (diff) | |
[feature][common] 模块common增加自定义异常类,用于捕获基础的受检查和非受检查异常类,基于当前功能给出更清晰的异常信息。
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/develop-guide.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/develop-guide.md b/docs/develop-guide.md index 5c55d47..0ae09c6 100644 --- a/docs/develop-guide.md +++ b/docs/develop-guide.md @@ -14,3 +14,15 @@ > - Description: The most important part of a commit message is that it should be clear and meaningful. > - JIRA Issue ID: Integrating JIRA is used for issue tracking. +## How to throw an exception in Groot Stream Platform +When throwing an exception with a hint message and ensure that the exception has a smaller scope. You can create a custom exception class that include error code and message parameter in its constructor. For example, if you encounters a checked exception `ClassNotFoundException` while dynamic class loading,a reasonable approach would be to the following: + +```java + try { + // Class.forname + } catch (ClassNotFoundException e) { + throw GrootStreamBootstrapException("Missing class or incorrect classpath", e); + } + ``` + + |
