Open 0xbs opened 3 years ago
Thanks for debugging 😉
As for the incident at hand, see https://github.com/marlon360/rki-covid-api/issues/321
As for the error handling: Yes, I'm aware that this is quick and dirty … and I'm not particularly proud of it 😉
As for the switch for the hospitalization: This is definitely feasible and on my list.
Turning of hospitalization is now possible in the latest version on master with param hosp=n
… at least a workaround until the API is fixed.
The API works now fine again.
Hello,
this error occurres again, I am getting:
2022-01-09 08:41:48: Getting hospitalization data: https://api.corona-zahlen.org/states 2022-01-09 08:41:48: {"error":{"message":"An error occurred while fetching external data.","details":"connect ETIMEDOUT 185.199.108.133:443","url":"https://raw.githubusercontent.com/robert-koch-institut/COVID-19-Hospitalisierungen_in_Deutschland/master/.zenodo.json","stack":"Error: connect ETIMEDOUT 185.199.108.133:443\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)\n at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)"}} 2022-01-09 08:41:48: Error on line 987:63: TypeError: undefined is not an object (evaluating 'hospitalizationData.data[bundesLand]')
I use 1.11.0
BG Markus P.S. Great Script!
Same here. Use hosp=n
as parameter as a workaround until the API is fixed (probably the RKI once again changed their Excel 🧐)
Ok. In the meantime I did this ` if (debug) { console.log("hospi"); console.log(hospitalizationData.error); console.log(hospitalizationData); // console.log(bundesland); }
if (!hospitalizationData || hospitalizationData.error) {
list.addText('Keine Hospitalisierungsdaten.');
return list;
} `
I also got „bundesland is undefined“ then
but location-call-result seems good
`
2022-01-09 09:01:27: location 2022-01-09 09:01:27: {"GEN":"Borken","EWZ_BL":17925570,"death_rate":1.25835938427446,"cases":25271,"deaths":318,"cases7_bl_per_100k":351.006969373917,"EWZ":371898,"BL":"Nordrhein-Westfalen","county":"LK Borken","cases7_per_100k":362.196086023587,"AGS":"05554"}
`
Yes. Everything else is working. Your suggestion for improving error handling is good. As for the variable holding the "Bundesland" it is bundesLand
with a capital L (do not ask me why …)
Thanks, editing on the phone is sometimes hard…
Sure. However, bundesLand
is quite unconventional with the capital L … should correct this.
Widget in version 1.10.0 shows an error message if used with
vac=y
:Underlying issue is the API for hospitalization rates https://api.corona-zahlen.org/states which returns the following error:
The response should be checked for an error object and not only for a truthy value.
Also an option to switch off the hospitalization rates would be desirable.