Skip to content

Feat(engine): make Start/Stop return error instead of log.Fatalf (#550) - #552

Merged
xjasonlyu merged 2 commits into
xjasonlyu:mainfrom
nange:feat/engine-start-stop-error
Sep 13, 2026
Merged

xjasonlyu merged 2 commits into
xjasonlyu:mainfrom
nange:feat/engine-start-stop-error

Conversation

@nange

@nange nange commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Fixes: #550

@nange

nange commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@xjasonlyu 麻烦看看。

@nange

nange commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

@xjasonlyu 可以合并这个 PR 吗 😀

@xjasonlyu
xjasonlyu requested a balanced review from Copilot September 6, 2026 22:06

This comment was marked as off-topic.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

main.go currently calls log.Fatalf inside a deferred cleanup, which can skip other deferred cleanups due to os.Exit semantics.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread main.go Outdated
@nange

nange commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

这个AI的review结果似乎不成立:

  1. 当前的改动没有改变原有逻辑。
  2. defer里面也没有其他要清理的东西了。

Keep Start/Stop returning errors for library callers, and move the
exit-on-failure behavior into the OrFatal variants used by main.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@xjasonlyu
xjasonlyu merged commit 5d9fac6 into xjasonlyu:main Sep 13, 2026
12 checks passed
@xjasonlyu

Copy link
Copy Markdown
Owner

已合并。

@nange
nange deleted the feat/engine-start-stop-error branch September 14, 2026 03:13
max-did-it pushed a commit to glitch-vpn/tun2socks that referenced this pull request Oct 26, 2026
* Feat(engine): make Start/Stop return error instead of log.Fatalf (xjasonlyu#550)

* Refactor(engine): add StartOrFatal/StopOrFatal wrappers

---------

Co-authored-by: Jason Lyu <xjasonlyu@gmail.com>
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.

[Feature] Make engine.Start and engine.Stop return error instead of log.Fatalf

3 participants