Skip to content

fix(status): Map USER_CREATOR to a friendly usage error#28

Merged
cuiko merged 1 commit into
vika2603:mainfrom
cuiko:fix/rpc-user-creator-mapping
Jun 4, 2026
Merged

fix(status): Map USER_CREATOR to a friendly usage error#28
cuiko merged 1 commit into
vika2603:mainfrom
cuiko:fix/rpc-user-creator-mapping

Conversation

@cuiko

@cuiko cuiko commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Editing the group/channel creator's admin or banned rights returns the raw RPC error USER_CREATOR, which previously surfaced to the user as the opaque rpcDoRequest: rpc error code 400: USER_CREATOR.
  • Classify tg.ErrUserCreator in the usage family (code: usage, exit 2) with the message this action isn't allowed on the group/channel creator, alongside the existing PARTICIPANT_ID_INVALID mapping that already references a creator target.

Test plan

  • go build ./..., go vet, golangci-lint run, go test ./...
  • Unit: USER_CREATOR added to the usage-family table test (asserts code=usage, exit 2, friendly non-rpc error message).
  • Live: an admin with add_admins promoting the group creator now returns
    {"error":{"code":"usage","message":"this action isn't allowed on the group/channel creator","rpc_error":"USER_CREATOR"},"exit_code":2}
    instead of the previous raw {"code":"unknown","message":"rpcDoRequest: rpc error code 400: USER_CREATOR"}. The rpc_error enum is preserved for programmatic matching.
  • No exit-code table change (reuses existing usage/exit-2).

Editing the group/channel creator's admin or banned rights returns the raw
RPC error USER_CREATOR, which previously reached the user as the opaque
"rpcDoRequest: rpc error code 400: USER_CREATOR". Classify it in the usage
family (exit 2) with a clear message, alongside the existing
PARTICIPANT_ID_INVALID that already covers a creator target.
@cuiko
cuiko merged commit 0080250 into vika2603:main Jun 4, 2026
1 check passed
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.

1 participant