Skip to content

refactor(savings): return typed errors from tag mutators#1061

Open
webmirroring wants to merge 1 commit into
Remitwise-Org:mainfrom
webmirroring:refactor/savings-tag-typed-errors-1015
Open

refactor(savings): return typed errors from tag mutators#1061
webmirroring wants to merge 1 commit into
Remitwise-Org:mainfrom
webmirroring:refactor/savings-tag-typed-errors-1015

Conversation

@webmirroring

Copy link
Copy Markdown

Summary

  • convert add_tags_to_goal and remove_tags_from_goal missing-goal paths from panic! to SavingsGoalError::GoalNotFound
  • convert owner-mismatch paths from panic! to SavingsGoalError::Unauthorized
  • add error doc comments and update existing tests to assert typed errors

Validation

  • cargo fmt -p savings_goals -- --check
  • git diff --check

Attempted but blocked locally:

  • cargo test -p savings_goals tags_to_goal --locked -- --nocapture
  • Blocker: local Cargo is 1.84.0 and cannot parse locked dependency base64ct 1.8.3 because it requires edition2024/Rust 1.85+. This environment has no rustup; the repo toolchain is stable, so CI with newer stable should be able to run it.

Security notes

  • Authorization requirement via caller.require_auth() is unchanged.
  • Invalid tag content behavior is preserved.
  • Only the public ABI error surface changes for goal-not-found and owner-mismatch tag mutations.

Fixes #1015

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.

Convert unauthorized/not-found panics in add_tags_to_goal and remove_tags_from_goal to typed SavingsGoalError

2 participants