File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ AlertOps
2
+
3
+ Sends a error event to AlertOps.
4
+ Follow http://help.alertops.com/default.aspx/MyWiki/Errorception.html for setup detail.
Original file line number Diff line number Diff line change
1
+ var request = require ( "request" ) ,
2
+ path = require ( "path" ) ;
3
+
4
+ exports . serviceName = "AlertOps" ;
5
+
6
+ exports . author = {
7
+ name : "Xinlin Ruan" ,
8
+
9
+ github : "AlertOps" ,
10
+ twitter : "AlertOps"
11
+ } ;
12
+
13
+ exports . onError = function ( error , settings , done ) {
14
+ request ( {
15
+ url : "https://notify.alertops.com/restapi.svc/POSTAlertV2/generic/"
16
+ + settings . apiKey + "/Errorception/" + settings . sourceName
17
+ + "/subject/id/none/none/webUrl/shortText/LongText" ,
18
+ method : "post" ,
19
+ body : JSON . stringify ( {
20
+ subject : "(Errorception) " + error . message ,
21
+ id : path . basename ( error . webUrl ) ,
22
+ webUrl : error . webUrl ,
23
+ shortText : "Error: " + error . message + " at time: " + error . date ,
24
+ LongText : "An Error " + error . message + ( error . isFirstOccurrence ? "occurred" : "recurred" ) + " in "
25
+ + ( error . isInline ?( "an inline script on " + error . page ) :error . scriptPath )
26
+ + " See " + error . webUrl + " for details"
27
+ } ) ,
28
+ timeout : 10000
29
+ } , done ) ;
30
+ }
You can’t perform that action at this time.
0 commit comments