Skip to content

refactor: change error definition in account PKG to Bucketeer error - #2125

Merged
kakcy merged 5 commits into
mainfrom
refactor-error-handle-account-3
Sep 30, 2025
Merged

refactor: change error definition in account PKG to Bucketeer error#2125
kakcy merged 5 commits into
mainfrom
refactor-error-handle-account-3

Conversation

@kakcy

@kakcy kakcy commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

This pull request refactors error handling in the account API service to standardize gRPC error responses using the new api.NewGRPCStatus helper. The previous approach of manually constructing localized error messages and attaching them to gRPC status objects is replaced with a simpler, unified method. This change improves consistency and maintainability across both main service code and associated tests.

I have also standardized the process of assigning ErrorInfo to GRPCStatus for each error via api.NewGRPCStatus.
This ErrorInfo will be used when moving i18n to the frontend(#1253), and we plan to generate error messages etc. based on this information on the frontend.

@kakcy
kakcy marked this pull request as ready for review September 22, 2025 06:39
nnnkkk7
nnnkkk7 previously approved these changes Sep 22, 2025

@nnnkkk7 nnnkkk7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks you!

# Conflicts:
#	pkg/account/api/admin_account.go
#	pkg/account/api/admin_account_test.go
#	pkg/account/api/api.go
#	pkg/account/api/api_key.go
#	pkg/account/api/api_key_test.go
#	pkg/account/storage/v2/admin_account.go
#	pkg/account/storage/v2/api_key.go

@hvn2k1 hvn2k1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@kakcy
kakcy merged commit 42ee1e1 into main Sep 30, 2025
12 checks passed
@kakcy
kakcy deleted the refactor-error-handle-account-3 branch September 30, 2025 03:28
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