Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning#3804
Merged
Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning#3804
Conversation
Member
|
|
Contributor
Author
|
|
Member
|
界面右边有一个 convert to draft 标示还没准备好合并 |
Contributor
Author
Member
|
移到 errors 吧 |
Contributor
Author
好了 |
Member
|
你多看看代码,能换成这两个函数的都用这两个函数吧,比如 VLESS 的 fallback->fallbacks, |
leninalive
pushed a commit
to amnezia-vpn/amnezia-xray-core
that referenced
this pull request
Oct 29, 2024
dragonbreath2000
pushed a commit
to dragonbreath2000/Xray-core
that referenced
this pull request
Dec 11, 2024
dragonbreath2000
pushed a commit
to dragonbreath2000/Xray-core
that referenced
this pull request
Dec 12, 2024
it2konst
pushed a commit
to it2konst/gametunnel-core
that referenced
this pull request
Mar 1, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


接 #3793
此次 pr 稍微修改了两个函数的提示描述,并且升级了
PrintRemovedFeatureError():此次修改使其在调用时可以正常返回错误从而达成一些遇到停用功能之后自动退出程序的效果,不需要再借助errors.New()(实际上该函数为其封装作为专用用途)。将
PrintRemovedFeatureError()应用到已移除功能上面,提示用户需要修改配置,并且有利于日后的残余代码清理(删除已久的功能):"security": "xtls"想给 QUIC 和 DomainSocket 也加上但是没留位置优点是只需在函数信息中填入功能名字即可。
缺点是每次使用这个函数都要引入 features 包,各方面可能不如引入 errors 包方便。