import Ember from "ember";
import config from "../config/environment";

export default Ember.Service.extend({
  session: Ember.inject.service(),

  error: function(reason) {
    if (reason.status === 0) {
      return;
    }
    console.info(reason);
    if (config.environment === "production") {
      var userName = this.get("session.currentUser.fullName");
      var userId = this.get("session.currentUser.id");
      Airbrake.push({
        error: reason,
        context: { userId: userId, userName: userName }
      });
    }
  }
});

@@ -405,24 +405,141 @@
 tUser.id%22);%0A
+      var error = reason instanceof Error %7C%7C typeof reason != %22object%22 ?%0A          reason : JSON.stringify(reason);%0A%0A
       Airbra
@@ -563,22 +563,21 @@
  error: 
-reason
+error
 ,%0A      

Improve error logger to log something more useful than "[object Object]"