Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,17 @@ Raven.prototype = {
return;
}

var data = {
message: msg,
options: options
};

this._triggerEvent('message', data);

// Fire away!
this._send(
objectMerge({
message: msg + '' // Make sure it's actually a string
message: data.message + '' // Make sure it's actually a string
}, options)
);

Expand Down Expand Up @@ -557,7 +564,7 @@ Raven.prototype = {
},

_triggerEvent: function(eventType, options) {
// NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
// NOTE: `event` is a native browser thing, so let's avoid conflicting with it
var evt, key;

if (!this._hasDocument)
Expand Down Expand Up @@ -986,6 +993,11 @@ Raven.prototype = {
// Try and clean up the packet before sending by truncating long values
data = this._trimPacket(data);

this._triggerEvent('presend', {
options: globalOptions,
data: data
});

this._logDebug('debug', 'Raven about to send:', data);

if (!this.isSetup()) return;
Expand Down