Built motion from commit fe909640.|2.6.8
[motion2.git] / server / errors / api.js
index 1dceb82..b88e9c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error'];(function(_0xc636c8,_0x5a4709){var _0x3db044=function(_0x26265b){while(--_0x26265b){_0xc636c8['push'](_0xc636c8['shift']());}};_0x3db044(++_0x5a4709);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0xe5b5[_0x4629ed];return _0x52ca04;};'use strict';var util=require(_0x5e5b('0x0'));var logger=require(_0x5e5b('0x1'))(_0x5e5b('0x2'));var APIError=function(_0x3b3efd,_0x208070){this[_0x5e5b('0x3')]=_0x3b3efd||_0x5e5b('0x4');this[_0x5e5b('0x5')]=_0x208070||_0x5e5b('0x6');util[_0x5e5b('0x7')](APIError,Error);};var APIBadRequestError=function(_0xdc6616){this[_0x5e5b('0x3')]=_0xdc6616||_0x5e5b('0x8');this[_0x5e5b('0x5')]=_0x5e5b('0x8');util[_0x5e5b('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xe089b1){this[_0x5e5b('0x3')]=_0xe089b1||_0x5e5b('0x9');this[_0x5e5b('0x5')]=_0x5e5b('0xa');util[_0x5e5b('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x3f8534){switch(_0x3f8534){case'Bad\x20Request':return 0x190;case _0x5e5b('0xb'),'OutOfInterval':return 0x193;case _0x5e5b('0xa'):return 0x194;default:return 0x1f4;}}function handleError(_0x58185){return function(_0x23e667){logger[_0x5e5b('0xc')](_0x23e667['stack']);var _0x4a1424=getStatusCode(_0x23e667['name']);if(_0x23e667[_0x5e5b('0x5')])delete _0x23e667[_0x5e5b('0x5')];return _0x58185[_0x5e5b('0xd')](_0x4a1424)[_0x5e5b('0xe')](_0x23e667);};}module[_0x5e5b('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0xb821=['status','exports','../config/logger','api','message','Error','inherits','name','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack'];(function(_0x5ed248,_0x599714){var _0x3a31d4=function(_0x90c6bf){while(--_0x90c6bf){_0x5ed248['push'](_0x5ed248['shift']());}};_0x3a31d4(++_0x599714);}(_0xb821,0xa7));var _0x1b82=function(_0x24da0a,_0x493823){_0x24da0a=_0x24da0a-0x0;var _0x12f206=_0xb821[_0x24da0a];return _0x12f206;};'use strict';var util=require('util');var logger=require(_0x1b82('0x0'))(_0x1b82('0x1'));var APIError=function(_0x5924c6,_0x4a4f81){this[_0x1b82('0x2')]=_0x5924c6||'Internal\x20Server\x20Error';this['name']=_0x4a4f81||_0x1b82('0x3');util[_0x1b82('0x4')](APIError,Error);};var APIBadRequestError=function(_0x3fadf0){this[_0x1b82('0x2')]=_0x3fadf0||'Bad\x20Request';this[_0x1b82('0x5')]=_0x1b82('0x6');util[_0x1b82('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3632dd){this[_0x1b82('0x2')]=_0x3632dd||_0x1b82('0x7');this[_0x1b82('0x5')]=_0x1b82('0x8');util[_0x1b82('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x4955b5){switch(_0x4955b5){case _0x1b82('0x6'):return 0x190;case _0x1b82('0x9'),_0x1b82('0xa'):return 0x193;case _0x1b82('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xcffb87){return function(_0x17a96b){logger[_0x1b82('0xb')](_0x17a96b[_0x1b82('0xc')]);var _0x5f521f=getStatusCode(_0x17a96b[_0x1b82('0x5')]);if(_0x17a96b[_0x1b82('0x5')])delete _0x17a96b[_0x1b82('0x5')];return _0xcffb87[_0x1b82('0xd')](_0x5f521f)['send'](_0x17a96b);};}module[_0x1b82('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file