Skip to content

Commit

Permalink
Bug fix for Exceptiosn constructor, included url by default in except…
Browse files Browse the repository at this point in the history
…ion, and changed log statements a bit
  • Loading branch information
steaks committed Jun 6, 2014
1 parent 7b2b018 commit ed7b5bc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions exceptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
function Exception(message, config) {
try {
if (!(this instanceof Exception)) {
return new Exception(config);
return new Exception(message, config);
}
var defaultOptions = this.constructor.defaultOptionsFunc()(new Options());

Expand Down Expand Up @@ -431,7 +431,7 @@

toString: function () {
if (this.message()) {
return this.name() + ": " + this.message();
return this.name() + " - " + this.message();
}
return this.name();
},
Expand All @@ -444,8 +444,10 @@

_populateDefaultDataProperties: function () {
var data = this.data();
data.browser = data.browser || utilities.getBrowser();
this._mergeErrorIntoData();
data.browser = data.browser || utilities.getBrowser();
data.url = data.url || window.location.href;
data.date = data.date || Date();
},

_mergeErrorIntoData: function () {
Expand Down Expand Up @@ -486,7 +488,7 @@
this._callback();
}
handler._pushReportedException(this);
console.log(this.toString() + " reported");
console.log("exceptions.js: " + this.toString());
console.log(this.toSerializableObject());
},
_retrieveStacktrace: function () {
Expand Down

0 comments on commit ed7b5bc

Please sign in to comment.