Comparing version 0.4.1 to 0.4.2
@@ -230,6 +230,6 @@ // | ||
callback(undefined, id); | ||
callback && callback(undefined, id); | ||
} else { | ||
var message = xre('message').exec(data); | ||
callback(new Error(message ? message[1] : data)); | ||
callback && callback(new Error(message ? message[1] : data)); | ||
} | ||
@@ -251,3 +251,3 @@ }; | ||
if (res.statusCode == 200) { | ||
callback(undefined); | ||
callback && callback(undefined); | ||
} else { | ||
@@ -259,3 +259,3 @@ var data = ''; | ||
var message = xre('message').exec(data); | ||
callback(new Error(message ? message[1] : data)) | ||
callback && callback(new Error(message ? message[1] : data)) | ||
}); | ||
@@ -268,2 +268,6 @@ } | ||
// Some sanity checking. It makes no sense to call this without a | ||
// callback. | ||
if (typeof callback != 'function') throw new Error('Callback must be a function'); | ||
// Prep the request. | ||
@@ -270,0 +274,0 @@ var httpOptions = this._createHttpOptions('routes.xml', 'GET'); |
{ | ||
"name": "mailgun", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Mailgun for Node.js", | ||
@@ -5,0 +5,0 @@ "author": "shz", |
@@ -156,3 +156,3 @@ # node-mailgun | ||
`createRoute(pattern, destination, callback(err, id))` | ||
`createRoute(pattern, destination, [callback(err, id)])` | ||
@@ -165,3 +165,3 @@ TODO - document arguments | ||
`deleteRoute(id, callback(err))` | ||
`deleteRoute(id, [callback(err)])` | ||
@@ -168,0 +168,0 @@ * id - Route ID, as returned by `getRoutes()` or `createRoute`. |
18280
263