Skip to content

[Core] Allow SignProvider to throw exceptions#107

Merged
Linwenxuan04 merged 2 commits into
mainfrom
noirhare/allow-sign-provider-to-throw-exceptions
Apr 9, 2026
Merged

[Core] Allow SignProvider to throw exceptions#107
Linwenxuan04 merged 2 commits into
mainfrom
noirhare/allow-sign-provider-to-throw-exceptions

Conversation

@NoirHare
Copy link
Copy Markdown
Collaborator

@NoirHare NoirHare commented Apr 9, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR changes signing behavior so BotSignProvider implementations can surface exceptions instead of swallowing them, and updates core packet send/refresh flows to handle those failures more explicitly.

Changes:

  • Remove broad try/catch blocks in multiple BotSignProvider implementations so failures can propagate.
  • Add exception handling around PacketContext.SendPacket background send work to complete the awaiting ValueTask with an error.
  • Wrap wtlogin.exchange_emp refresh timer logic in a try/catch to avoid unhandled exceptions during periodic refresh.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Lagrange.Milky/Utility/Signer.cs Stops swallowing signer HTTP/serialization errors so exceptions can propagate.
Lagrange.Core/Internal/Logic/WtExchangeLogic.cs Adds defensive try/catch around periodic ExchangeEmp refresh execution.
Lagrange.Core/Internal/Context/PacketContext.cs Catches signing/packing/sending exceptions and completes the pending request task exceptionally.
Lagrange.Core/Common/BotSignProvider.cs Default (non-Android) sign provider now allows exceptions to propagate.
Lagrange.Core/Common/AndroidBotSignProvider.cs Android sign/energy/debug calls now allow exceptions to propagate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Lagrange.Core/Internal/Context/PacketContext.cs Outdated
Comment thread Lagrange.Milky/Utility/Signer.cs
Comment thread Lagrange.Core/Common/BotSignProvider.cs
Comment thread Lagrange.Core/Common/AndroidBotSignProvider.cs
Comment thread Lagrange.Core/Common/AndroidBotSignProvider.cs
Comment thread Lagrange.Core/Common/AndroidBotSignProvider.cs
@Linwenxuan04 Linwenxuan04 merged commit 4810cd7 into main Apr 9, 2026
12 checks passed
@Linwenxuan04 Linwenxuan04 deleted the noirhare/allow-sign-provider-to-throw-exceptions branch April 9, 2026 09:31
Bemly pushed a commit to Bemly/CharonAnchor that referenced this pull request May 3, 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