Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initTanker = async () => {
try {
const res = await doRequest(`${serverRoot}/config`);
const config = await res.json();
this.tanker = new Tanker(config);
this.log('initTanker', config.appId);
this.setState({ loading: false });
} catch (e) {
this.log(e);
// Could it be that the server is not started yet?
if (!(e instanceof errors.TankerError)) {
this.log('serverHint');
}
}
}