Skip to content

Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning#3804

Merged
RPRX merged 8 commits intoXTLS:mainfrom
KobeArthurScofield:removal-replace
Sep 15, 2024
Merged

Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning#3804
RPRX merged 8 commits intoXTLS:mainfrom
KobeArthurScofield:removal-replace

Conversation

@KobeArthurScofield
Copy link
Contributor

@KobeArthurScofield KobeArthurScofield commented Sep 12, 2024

#3793

  • 此次 pr 稍微修改了两个函数的提示描述,并且升级了 PrintRemovedFeatureError() :此次修改使其在调用时可以正常返回错误从而达成一些遇到停用功能之后自动退出程序的效果,不需要再借助 errors.New() (实际上该函数为其封装作为专用用途)。

  • PrintRemovedFeatureError() 应用到已移除功能上面,提示用户需要修改配置,并且有利于日后的残余代码清理(删除已久的功能):

    • Trojan Flow
    • "security": "xtls"
    • 全局传输设置

想给 QUIC 和 DomainSocket 也加上但是没留位置

优点是只需在函数信息中填入功能名字即可。
缺点是每次使用这个函数都要引入 features 包,各方面可能不如引入 errors 包方便。

@Fangliding
Copy link
Member

不用大型连续剧的 讨论讨论把相关功能可以在一个pr里改好是最好的

@KobeArthurScofield
Copy link
Contributor Author

KobeArthurScofield commented Sep 12, 2024

但愿这次不要突然就合了手速稳一点是好的

@Fangliding
Copy link
Member

界面右边有一个 convert to draft 标示还没准备好合并

@KobeArthurScofield KobeArthurScofield marked this pull request as draft September 12, 2024 19:00
@KobeArthurScofield
Copy link
Contributor Author

现在应该差不多了,效果应该可以:
image
image

然后是

  1. 文本要不要再调整;
  2. 是留在 features 包里面还是移到 errors 包里面方便调用?

都没问题就 ok 了

@KobeArthurScofield KobeArthurScofield marked this pull request as ready for review September 14, 2024 14:36
@RPRX
Copy link
Member

RPRX commented Sep 15, 2024

移到 errors 吧

@KobeArthurScofield
Copy link
Contributor Author

移到 errors 吧

好了

@RPRX RPRX changed the title Features: Replace removed functions errors Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning Sep 15, 2024
@RPRX RPRX merged commit 5f0642a into XTLS:main Sep 15, 2024
@RPRX
Copy link
Member

RPRX commented Sep 15, 2024

你多看看代码,能换成这两个函数的都用这两个函数吧,比如 VLESS 的 fallback->fallbacks,虽然这个太久了好像可以直接删掉了

@KobeArthurScofield KobeArthurScofield deleted the removal-replace branch September 15, 2024 06:57
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants