Page MenuHomePhabricator

Display API failure errors in the IPInfo popup
Open, Needs TriagePublic

Description

After T260604: Display a popup with fixed mock data for an IP address on the specified page(s), mock data is displayed in the IPInfo popup, when the API successfully returns data.

When the API responds with a failure code, we should also display an appropriate failure message.

Questions:

  • What should the error message look like?(See below)~~
  • What should the text say? (The API returns a JSON object with translated messages: https://www.mediawiki.org/wiki/API:REST_API/Status_codes - however, if we use these, we'd be limited to the languages given, and would not be able to use the fall-back algorithm for missing languages.)

Note that T263409 is specifically for displaying timeout errors.

Popup error states:

image.png (162×564 px, 22 KB)

Figma

Event Timeline

Niharika added subscribers: Prtksxna, Niharika.

@Prtksxna Adding this to your column. Let's talk more about this in our meeting.

Here are some of the current error messages for logs and revisions and the circumstances when they appear. I am not sure it is exhaustive:

CaseHTTP codeLog MessageRevision Message
Logged out401"You do not have permission to perform the action""You do not have permission to perform the action"
User pref disabled or no ipinfo right403"You do not have permission to perform the action""You do not have permission to perform the action"
Log or revision does not exist404"Log entry does not exist""The specified revision (<rev id>) does not exist"
User does not have permission to log/revision403"Your account does not have access to view the performer of the log entry or the log entry itself""Your account does not have access to view the author of the revision"
Log/revision is not an IP404"Cannot retrieve ipinfo for logs of registered users""Cannot retrieve ipinfo for revisions of registered users"
No error, but API returns no information200"There is no data for this IP address from GeoIp2""There is no data for this IP address from GeoIp2"