如何处理firebase库异常?

时间:2016-06-29 12:21:45

标签: node.js firebase nest-api

由于firebase-node.js库中的异常,我的Nodejs服务器崩溃了!

var thermostateTree = nestAccounts[self.mac].firebaseClient.child('devices').child('thermostats').child(self.id);  

var callback = function(err){
if (err)
  logger.info('[%s] [Nest] [setTargetTemperature] failed to set target temperature. ', self.mac);
else
  logger.info('[%s] [Nest] [setTargetTemperature] target temperature changed', self.mac);
};

thermostateTree.update({
 'target_temperature_high_f' : max_temperature,
 'target_temperature_low_f' : min_temperature
}, callback);

如何处理以下异常?

  

uncaughtException:已阻止:{"错误":"已屏蔽","键入":" https://developer.nest.com/documentation/cloud/error-messages#blocked",& #34;消息":"阻止","实例":" d7d74b5c-325b-4360-bf77-7c7f9e385caf"} date = Wed Jun 29 2016 02 :49:34 GMT-0400(EDT),pid = 9737,uid = 1000,gid = 1000,cwd = / home / centos / NodeJSCID,execPath = / usr / bin / node,version = v0.10.40,argv = [ / usr / bin / node,/ home /centos / NodeJSCID / server-xmpp.js,slave,nest],rss = 189448192,heapTotal = 137562624,heapUsed = 87270704,loadavg = [0.0029296875,0.0341796875,0.04541015625],正常运行时间= 5355060.0423008 ,trace = [column = null,file = null,function = Error,line = null,method = null,native = false,column = 115,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node .js,function = null,line = 226,method = null,native = false,column = 165,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node.js,function = ec,line = 52,method = null,native = false,column = 23,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node.js,function = Pi ,line = 226,method = null,native = false,column = 435,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node.js,function = null,line = 222,method = null, native = false,column = 355,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node.js,function = null,line = 184,method = null,native = false,column = 104,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node.js,function = Rh.h.Jd,line = 186,method = h.Jd,native = false,column = 364,file = / home /centos/NodeJSCID/node_modules/firebase/lib/firebase-node.js,function = Fh.Jd,line = 176,method = Jd,native = false,column = 280,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node.js,function = wh.Jg,line = 174,method = Jg,native = false,column = 464,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node .js,function = zh,line = 168,method = null,native = false,column = 321,file = / home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node.js,function = Ka.onmessage, line = 167,method = onmessage,native = fals e,column = 30,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / lib / faye / websocket / api / event_target.js,function = EventTarget.dispatchEvent,line = 22,method = dispatchEvent ,native = false,column = 10,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / lib / faye / websocket / api.js,function = instance._receiveMessage,line = 134,method = _receiveMessage,native = false,column = 49,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / lib / faye / websocket / api.js,function =,line = 34,method = null, native = false,column = 20,file = events.js,function = emit,line = 117,method = null,native = false,column = 14,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye -websocket / node_modules / websocket-driver / lib / websocket / driver / hybi.js,function =,line = 451,method = null,native = false,column = 40,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules /菲-的WebSocket / node_modules / WebSocket的驱动器/ node_modules / WebSocket的-extensi ons / lib / pipeline / index.js,function = pipe,line = 37,method = null,native = false,column = 3,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / node_modules /websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js,function = Pipeline._loop,line = 44,method = _loop,native = false,column = 8,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / node_modules / websocket-driver / node_modules / websocket-extensions / lib / pipeline / index.js,function = Pipeline.processIncomingMessage,line = 13,method = processIncomingMessage,native = false,column = 20,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / node_modules / websocket-driver / node_modules / websocket-extensions / lib / websocket_extensions.js,function = instance.processIncomingMessage,line = 133,method = processIncomingMessage,native = false,column = 22,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / node_modules / websocket-driver / lib / websocket / dr iver / hybi.js,function = instance._emitMessage,line = 442,method = _emitMessage,native = false,column = 19,file = / home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / node_modules / websocket -driver / lib / websocket / driver / hybi.js,function = instance._emitFrame,line = 405,method = _emitFrame,native = false],stack = [错误:阻塞:{"错误":& #34;封端的""类型":" https://developer.nest.com/documentation/cloud/error-messages#blocked""消息":"封端的",& #34;实例":" d7d74b5c-325b-4360-bf77-7c7f9e385caf"},在Error()处于/home/centos/NodeJSCID/node_modules/firebase/lib/firebase-node.js :226:115,在ec(/home/centos/NodeJSCID/node_modules/firebase/lib/firebase-node.js:52:165),在Pi(/ home / centos / NodeJSCID / node_modules / firebase / lib / firebase- node.js:226:23),位于/home/centos/NodeJSCID/node_modules/firebase/lib/firebase-node.js:222:435,位于/ home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node .js:184:355,在Rh.h.Jd(/ home / centos / NodeJSCID / node_modules / fireba se / lib / firebase-node.js:186:104),在Fh.Jd(/home/centos/NodeJSCID/node_modules/firebase/lib/firebase-node.js:176:364),wh.Jg(/ home / centos / NodeJSCID / node_modules / firebase / lib / firebase-node.js:174:280),在zh(/home/centos/NodeJSCID/node_modules/firebase/lib/firebase-node.js:168:464),在Ka.onmessage(/home/centos/NodeJSCID/node_modules/firebase/lib/firebase-node.js:167:321),在EventTarget.dispatchEvent(/ home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket) /lib/faye/websocket/api/event_target.js:22:30),at instance._receiveMessage(/home/centos/NodeJSCID/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api.js: 134:10),无效。 (/home/centos/NodeJSCID/node_modules/firebase/node_modules/faye-websocket/lib/faye/websocket/api.js:34:49),在emit(events.js:117:20)处,为null。 (/home/centos/NodeJSCID/node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/lib/websocket/driver/hybi.js:451:14),在管道上(/ home / centos / NodeJSCID / node_modules) /firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/lib/pipeline/index.js:37:40),在Pipeline._loop(/ home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / node_modules / websocket-driver / node_modules / websocket-extensions / lib / pipeline / index.js:44:3),在Pipeline.processIncomingMessage(/ home / centos / NodeJSCID / node_modules / firebase / node_modules / faye) -websocket / node_modules / websocket-driver / node_modules / websocket-extensions / lib / pipeline / index.js:13:8),at instance.processIncomingMessage(/ home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket / node_modules / websocket-driver / node_modules / websocket-extensions / lib / websocket_extensions.js:133:20),at instance._emitMessage(/ home / centos / NodeJSCID / node_modules / fir ebase / node_modules / faye-websocket / node_modules / websocket-driver / lib / websocket / driver / hybi.js:442:22),at instance._emitFrame(/ home / centos / NodeJSCID / node_modules / firebase / node_modules / faye-websocket /node_modules/websocket-driver/lib/websocket/driver/hybi.js:405:19)]

0 个答案:

没有答案