Page MenuHomePhabricator

Trying to add a nonexistent group to an aggregate group should have a better error message
Closed, ResolvedPublic1 Estimated Story PointsPRODUCTION ERROR

Description

Discovered from T372226

https://meta.wikimedia.org/wiki/Special:ApiSandbox#action=aggregategroups&format=json&do=associate&aggregategroup=agg-Community_Wishlist_wishes&group=ddfgfdg&groupname=sdfsdf&token=bc34768595fb4099fb29ca3790fd85e466b9706f%2B%5C&formatversion=2

{
    "error": {
        "code": "internal_api_error_TypeError",
        "info": "[82225218-0c04-4822-a871-129b909b45dd] Caught exception of type TypeError",
        "errorclass": "TypeError"
    },
    "servedby": "mw-api-ext.eqiad.main-857c9bf676-j425k"
}

This user error should be reported to the user as a user error, not an internal API error that enters the logs

Event Timeline

Change #1061617 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/Translate@master] Extra validity check for aggregate group

https://gerrit.wikimedia.org/r/1061617

abi_ triaged this task as Medium priority.
abi_ set the point value for this task to 1.
Aklapper changed the subtype of this task from "Task" to "Production Error".Aug 12 2024, 7:31 AM

Change #1061617 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Extra validity check for aggregate group

https://gerrit.wikimedia.org/r/1061617

abi_ subscribed.

https://meta.wikimedia.org/wiki/Special:ApiSandbox#action=aggregategroups&format=json&do=associate&aggregategroup=agg-Community_Wishlist_wishes&group=ddfgfdg&groupname=sdfsdf&token=bc34768595fb4099fb29ca3790fd85e466b9706f%2B%5C&formatversion=2

Returns

{
    "error": {
        "code": "invalidgroup",
        "info": "Group does not exist or is invalid",
        "docref": "See https://meta.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
    },
    "servedby": "mw-api-ext.eqiad.main-5744d5b77-f2jrb"
}