wordpress-connector-for-mobilizon / connector-mobilizon

Connector for Mobilizon
Apache License 2.0
8 stars 1 forks source link

Display "Group not found" as error message #11

Closed dwaxweiler closed 2 years ago

dwaxweiler commented 3 years ago

Steps to reproduce

  1. Enter the name of a group that does not exist into the filter field of the widget or snippet.
  2. Save / Update.
  3. Look at the page.

What happens The text "The events could not be loaded!" is shown instead of events. In the console, the following error is displayed:

Error: Group not found: {"response":{"data":{"group":null},"errors":[{"code":"group_not_found","field":null,"locations":[{"column":7,"line":3}],"message":"Group not found","path":["group"],"status_code":404}],"status":200},"request":{"query":"\n query ($afterDatetime: DateTime, $groupName: String, $limit: Int) {\n group(preferredUsername: $groupName) {\n organizedEvents(afterDatetime: $afterDatetime, limit: $limit) {\n elements {\n id,\n title,\n url,\n beginsOn,\n endsOn,\n physicalAddress {\n description,\n locality\n }\n },\n total\n }\n }\n }\n ","variables":{"afterDatetime":"2021-08-15T21:29:46.432+02:00","groupName":"XYZ group","limit":5}}}

What should happen The clearer error message from the console is displayed instead of the general error message.