avatar

Andres Jaimes

Error handling for JS fetch requests

The following example handles server and connectivity errors for javascript fetch requests. 1function handleErrors(response) { 2 if (!response.ok) throw new Error(response.status) 3 return response 4} 5 6fetch('https://jsonplaceholder.typicode.com/todos/1') 7 // handle network err/success 8 .then(handleErrors) 9 // use response of network on fetch Promise resolve 10 .then(response => console.log("ok")) 11 // handle fetch Promise error 12 .catch(error => console.log('found an error: ', error)) handleErrors can be updated for handling different types of errors in different ways.

Google+

El día de hoy obtuve una de las codiciadas cuentas en Google+. A primera vista pareciera que estamos tratando con una copia de FaceBook, pues tiene cosas como los mensajes de estado y las fotografías… pero esconde muchas otras más.

No more spam…

Ok spammers, I’m tired. During the last weeks I was getting about 100 spam messages per hour. That was very difficult to control. So I decided to take that as an opportunity to upgrade my server. Now my website runs on the latest WordPress engine and I have also installed some new antispam plugins. All the website contents will be updated and uploaded during this month. I appreciate your patience while I finish applying this upgrade.