forked from apache/kyuubi
-
Notifications
You must be signed in to change notification settings - Fork 0
Update AdminResource.scala #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yanghua
wants to merge
1
commit into
master
Choose a base branch
from
yanghua-patch-7
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段代码补丁并没有显著的漏洞风险。对于改进建议,我可能会提出以下几点:
在捕获异常和处理错误时,应该尽可能具体和明确。在这个例子中,
NoNodeException
是一个非常具体的异常,指示 ZooKeeper 的节点不存在。在这里使用它是恰当的,但是我们可能需要更多的上下文信息来确定这是最好的异常,还是应该使用通用的Exception
。应考虑在出现错误时提供更详细的日志记录信息。在这个例子中,如果出现
NoNodeException
错误,则会在日志中打印一条信息,并抛出NotFoundException
。这是好的,但更详细的信息有助于诊断和修复错误。最后,可以为方法添加测试用例以确保其正确性。