When calling GetByUsername, the execution jumps to catch block but err is undefined. The api is working because the equivalent promise style code .then().then().done() works, but I'd like to write in this async / await style better. How can I debug it ?
var cli = {
GetByUsername: async function(username) {
try {
let resposne = await fetch(`http://api.example.com?username=${username}`);
return response;
} catch(err) {
debugger;
}
}
}
edit:
By looking at react-native's package.json it seems that the fetch implementation used is node-fetch and babeljs
as transpiler.