19.04.2021, 11:04
I have modified the code so it works shown in the alert log the text Failed to load the Openweather weather information, if you put the return.
The issue is that the error does not appear after successfully executing the script several times. I think only the first time.
Code:
-- Comprobación de errores
if type(Tabla_tiempo) == 'table' then -- Si el contenido de la variable es distinto a una tabla entonces
alert('Fallo al cargar la información del tiempo de Openweather')
-- Si la llamada devuelve el codigo de error 401, 404 0 429
elseif Tabla_tiempo.cod == 401 then
alert('Fallo con la llave de la API de Openweather') -- Mensajes de error
elseif Tabla_tiempo.cod == 404 then
alert('Fallo en la solicitud de la API de Openweather')
elseif Tabla_tiempo.cod == 429 then
alert('Fallo por exceder el límite de llamadas a la API de Openweather')
return
end