login: wrap and propagate errors - #60
Merged
Merged
Conversation
tulir
reviewed
Aug 12, 2026
Member
|
oh bridgev2's RespError wrapper is missing WithInternalError 🙃 needs to be added in mautrix-go |
Expired or invalid cookies are the entire failure surface of a cookie login, and linkedingo already models one case as ErrTokenInvalidated, but the login flow wrapped everything in a plain fmt.Errorf. The provisioning API then replaced it with a generic 500 M_UNKNOWN "Internal error in login step", so "your cookies expired, export fresh ones" reached the user as an internal error. Most bad-cookie failures actually surface as a non-2xx status rather than ErrTokenInvalidated, and that was an untyped fmt.Errorf carrying only a formatted message. Add a typed linkedingo.ResponseError so callers can branch on the status code, then map both it and ErrTokenInvalidated onto declared RespErrors, including LinkedIn's 999 bot-block status. Also use bridgev2.ErrInvalidLoginFlowID for unknown flow IDs so they 404 instead of 500.
Co-authored-by: Tulir Asokan <tulir@maunium.net>
Fizzadar
force-pushed
the
nick/login-error-propagation
branch
from
September 1, 2026 15:29
a1cac85 to
3e8c710
Compare
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.
No description provided.