Saltar al contenido principal
Esta página no tiene versión en español, así que te la mostramos en inglés.

Catch Error in HTTP Request

This job was provided by an OpenFn.org user via the job library API.

Metadata​

  • Name: Catch Error in HTTP Request
  • Adaptor: @openfn/language-http
  • Adaptor Version: latest
  • Created about 10 years ago
  • Updated almost 4 years ago
  • Score: 0 (an indicator of how useful this job may be)

Key Functions​

get, JSON

Expression​

get(
'https://jsonplaceholder.typicode.com/wrongUrl', // the url
{
transformResponse: [
data => {
console.log("The data from the response, BEFORE the error is thrown");
console.log(JSON.stringify(data, null, 2))
return data;
}
],
}, // no additional options
state => { // the callback
console.log('the data', state.data)
return state;
}
);