You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the MMM-Mensamuc module, an error occurs when attempting to fetch the menu data from the API. The error appears to be triggered when the API responds with an HTML document (e.g., a 404 page) instead of the expected JSON format. This results in the following error being logged:
MMM-Mensamuc.js:38 Error fetching menu: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON MMM-Mensamuc.js:29 GET https://tum-dev.github.io/eat-api/mensa-lothstr/2024/34.json 404 (Not Found)
Steps to Reproduce:
Set up the MMM-Mensamuc module.
Configure the module to use a canteen for which there is no data available (e.g., by setting the canteen property to mensa-lothstr during a week where the data file is not available).
Observe the error in the developer console.
Expected Behavior:
If the API response is not valid JSON or if a 404 error occurs, the module should handle the error gracefully by displaying a message such as "No menu available yet" instead of logging a syntax error.
Actual Behavior:
The module attempts to parse the HTML error page as JSON, leading to a syntax error being logged in the console.
The text was updated successfully, but these errors were encountered:
Description:
When using the
MMM-Mensamuc
module, an error occurs when attempting to fetch the menu data from the API. The error appears to be triggered when the API responds with an HTML document (e.g., a 404 page) instead of the expected JSON format. This results in the following error being logged:MMM-Mensamuc.js:38 Error fetching menu: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON MMM-Mensamuc.js:29 GET https://tum-dev.github.io/eat-api/mensa-lothstr/2024/34.json 404 (Not Found)
Steps to Reproduce:
MMM-Mensamuc
module.canteen
property tomensa-lothstr
during a week where the data file is not available).Expected Behavior:
If the API response is not valid JSON or if a 404 error occurs, the module should handle the error gracefully by displaying a message such as "No menu available yet" instead of logging a syntax error.
Actual Behavior:
The module attempts to parse the HTML error page as JSON, leading to a syntax error being logged in the console.
The text was updated successfully, but these errors were encountered: