How to use the @tanker/client-browser.errors.TankerError function in @tanker/client-browser

To help you get started, we’ve selected a few @tanker/client-browser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TankerHQ / quickstart-examples / client / web / api-observer / src / App.js View on Github external
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');
      }
    }
  }