npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-uncharted-errors

v0.0.9

Published

This library pulls together several different types of ember errors and reports them in a single event called `reportError`

Downloads

10

Readme

UnchartedCode Errors Build Status

This library pulls together several different types of ember errors and reports them in a single event called reportError. It's meant to be used to send these errors to external reporting services.

Installation

ember install:addon ember-cli-uncharted-errors

Usage

Once you install this within your project it will automatically pull errors out of Ember.onerror, Ember.RSVP.error, Ember.ActionHandler and error within the application route. Several events will be spun off depending on the status (if it's an HTTP error.)

Unauthorized

If the error received has an HTTP status of 401 it will trigger the event authorizationFailed. You can capture that in your route and handle appropriately. Here is an example from the UserLoginRoute.

  actions: {
    authorizationFailed: function(transition) {
      var controller = this.controllerFor('user.login');
      controller.set('error', true);
      controller.set('loading', false);
    }
  }

Unavailable

If the error received has an HTTP status of 503 it will trigger the event reportUnavailable. This will essentially mean the server is in maintenance. Handling of this will depend from app to app and this will give you a good spot to notify your users of the maintenance and (optionally) retry the transition.

  actions: {
    reportUnavailable: function(transition) {
      alert('Service is temporarily unavailble');
    }
  }

Error

The main event in this library is reportError. It's meant to either report the error to the user or to a third-party system. In this example we're reporting to Sentry.

  actions: {
    reportError: function(error, context, route, transition) {
      if (!window.Raven) {
        return;
      }

      var context;

      if (route) {
        context = Ember.$.extend(context, {
          server_revision: route.get('version.server_version'),
          browser_revision: route.get('version.client_version')
        });

        Raven.setUser({
          email: route.get('current_user.email')
          id: route.get('current_user.id')
        });
      }

      Raven.captureException(error, { extra: context });
    }
  }

Development

Installation

  • git clone this repository
  • npm install
  • bower install

Running

  • ember server
  • Visit your app at http://localhost:4200.

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.