mirror of https://github.com/calzoneman/sync.git
Add try-catch to urlRetrieve to prevent uncaught HTTPS exceptions
This commit is contained in:
parent
dba93ca3b6
commit
9c22fbc462
|
@ -17,6 +17,7 @@ var CustomEmbedFilter = require("./customembed").filter;
|
||||||
|
|
||||||
module.exports = function (Server) {
|
module.exports = function (Server) {
|
||||||
function urlRetrieve(transport, options, callback) {
|
function urlRetrieve(transport, options, callback) {
|
||||||
|
try {
|
||||||
var req = transport.request(options, function (res) {
|
var req = transport.request(options, function (res) {
|
||||||
var buffer = "";
|
var buffer = "";
|
||||||
res.setEncoding("utf-8");
|
res.setEncoding("utf-8");
|
||||||
|
@ -29,6 +30,9 @@ module.exports = function (Server) {
|
||||||
});
|
});
|
||||||
|
|
||||||
req.end();
|
req.end();
|
||||||
|
} catch(e) {
|
||||||
|
callback(503, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var Getters = {
|
var Getters = {
|
||||||
|
|
Loading…
Reference in New Issue