How to use the elements-sk/errorMessage.errorMessage function in elements-sk

To help you get started, we’ve selected a few elements-sk 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 google / skia-buildbot / golden / modules / digest-details-sk / digest-details-sk.ts View on Github external
}).then((resp) => {
      if (resp.ok) {
        // Triaging was successful.
        this.status = newStatus;
        this.triageHistory.unshift({
          user: 'me',
          ts: Date.now().toString(),
        });
        this._render();
        sendEndTask(this);
      } else {
        // Triaging did not work (possibly because the user was not logged in). We want to set
        // the status of the triage-sk back to what it was to give a visual indication it did not
        // go through. Additionally, toast error message should catch the user's attention.
        console.error(resp);
        errorMessage(
            `Unexpected error triaging: ${resp.status} ${resp.statusText} ` +
            '(Are you logged in with the right account?)', 8000);
        this.querySelector('triage-sk')!.value = this.status;
        this._render();
        sendEndTask(this);
      }
    }).catch((e) => {
      sendFetchError(this, e, 'triaging')
github google / skia-buildbot / fiddlek / modules / fiddle-sk / fiddle-sk.ts View on Github external
});
      const results = (await jsonOrThrow(request)) as RunResults;

      // The .text field returned is empty, so repopulate it with the value we
      // stored in body.
      results.text = body.code;
      this.runResults = results;
      this._render();
      this.dispatchEvent(
        new CustomEvent('fiddle-success', {
          detail: this._runResults.fiddleHash,
          bubbles: true,
        }),
      );
    } catch (error) {
      errorMessage(error);
    } finally {
      this.spinner!.active = false;
    }
  }
github google / skia-buildbot / perf / modules / alert-config-sk / alert-config-sk.js View on Github external
}).catch((msg) => {
      this._alertSpinner.active = false;
      errorMessage(msg);
    });
  }
github google / skia-buildbot / skottie / modules / skottie-config-sk / skottie-config-sk.js View on Github external
this._state.filename = toLoad.name;

        this._width = DEFAULT_SIZE;
        this._height = DEFAULT_SIZE;
        this._render();
      });
      reader.addEventListener('error', () => {
        errorMessage('Failed to load '+ toLoad.name);
      });
      reader.readAsDataURL(toLoad);
    } else {
      let msg = `Bad file type ${toLoad.name}, only .json and .zip supported`;
      if (!allowZips) {
        msg = `Bad file type ${toLoad.name}, only .json supported`;
      }
      errorMessage(msg);
      this._state.filename = '';
      this._state.lottie = '';
    }
  }
github google / skia-buildbot / ct / modules / metrics-analysis-sk / metrics-analysis-sk.ts View on Github external
_validateTask(): void {
    if (!$('patch-sk', this).every((patch) => (patch as PatchSk).validate())) {
      return;
    }
    if (!($$('#metric_name', this) as InputSk).value) {
      errorMessage('Please specify a metric name');
      ($$('#metric_name', this) as InputSk).focus();
      return;
    }
    if (!($$('#analysis_task_id', this) as InputSk).value && !($$('#custom_traces', this) as InputSk).value) {
      errorMessage('Please specify an analysis task id or custom traces');
      ($$('#analysis_task_id', this) as InputSk).focus();
      return;
    }
    if (!($$('#description', this) as InputSk).value) {
      errorMessage('Please specify a description');
      ($$('#description', this) as InputSk).focus();
      return;
    }
    if (this._moreThanThreeActiveTasks()) {
      return;
    }
github google / skia-buildbot / perf / modules / explore-sk / explore-sk.js View on Github external
_add(replace) {
    this._queryDialog.close();
    const q = this._query.current_query;
    if (!q || q.trim() === '') {
      errorMessage('The query must not be empty.');
      return;
    }
    this.state = Object.assign({}, this.state, this._range.state);
    if (replace) {
      this._removeAll(true);
    }
    if (this.state.queries.indexOf(q) === -1) {
      this.state.queries.push(q);
    }
    const body = this._requestFrameBodyFullFromState();
    this._requestFrame(body, (json) => {
      this._addTraces(json, true);
    });
  }
github google / skia-buildbot / perf / modules / explore-sk / explore-sk.js View on Github external
_catch(msg) {
    this._requestId = '';
    if (msg) {
      errorMessage(msg, 10000);
    }
    this._percent.textContent = '';
    this.spinning = false;
  }
github google / skia-buildbot / pulld / modules / pulld-app-sk / pulld-app-sk.js View on Github external
}).then(jsonOrThrow).then(json => {
      errorMessage(e.detail.name + ": " + json.result);
      this._loadData();
    }).catch(errorMessage);
  }
github google / skia-buildbot / bugs-central / modules / bugs-central-sk / bugs-central-sk.ts View on Github external
private async doImpl(url: string, detail: any, action: (json: any)=> void): Promise {
    try {
      const resp = await fetch(url, {
        body: JSON.stringify(detail),
        headers: {
          'content-type': 'application/json',
        },
        credentials: 'include',
        method: 'POST',
      });
      const json = await jsonOrThrow(resp);
      action(json);
    } catch (msg) {
      errorMessage(msg);
    }
  }

elements-sk

A set of light-weight custom elements with a uniform style.

Apache-2.0
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis