Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / errors / api.js
index 4753ee1..4979764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Forbidden','OutOfInterval','Not\x20Found','status','send','util','../config/logger','api'];(function(_0x451fa0,_0x1238f9){var _0x537adb=function(_0x2a075){while(--_0x2a075){_0x451fa0['push'](_0x451fa0['shift']());}};_0x537adb(++_0x1238f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var APIError=function(_0x5dd881,_0x550fbc){this[_0x0a9e('0x3')]=_0x5dd881||'Internal\x20Server\x20Error';this[_0x0a9e('0x4')]=_0x550fbc||_0x0a9e('0x5');util[_0x0a9e('0x6')](APIError,Error);};var APIBadRequestError=function(_0x991246){this[_0x0a9e('0x3')]=_0x991246||'Bad\x20Request';this[_0x0a9e('0x4')]=_0x0a9e('0x7');util[_0x0a9e('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x5f41ea){this['message']=_0x5f41ea||_0x0a9e('0x8');this['name']='Not\x20Found';util[_0x0a9e('0x6')](APINotFoundError,APIError);};function getStatusCode(_0xf81284){switch(_0xf81284){case _0x0a9e('0x7'):return 0x190;case _0x0a9e('0x9'),_0x0a9e('0xa'):return 0x193;case _0x0a9e('0xb'):return 0x194;default:return 0x1f4;}}function handleError(_0x4a4c56){return function(_0x50dfb2){logger['error'](_0x50dfb2['stack']);var _0x273d4d=getStatusCode(_0x50dfb2[_0x0a9e('0x4')]);if(_0x50dfb2[_0x0a9e('0x4')])delete _0x50dfb2[_0x0a9e('0x4')];return _0x4a4c56[_0x0a9e('0xc')](_0x273d4d)[_0x0a9e('0xd')](_0x50dfb2);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0xd8b0=['Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','stack','status','send','exports','util','../config/logger','message','Internal\x20Server\x20Error','name','Error','inherits'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('api');var APIError=function(_0x585166,_0x4b72b0){this[_0x0d8b('0x2')]=_0x585166||_0x0d8b('0x3');this[_0x0d8b('0x4')]=_0x4b72b0||_0x0d8b('0x5');util[_0x0d8b('0x6')](APIError,Error);};var APIBadRequestError=function(_0x577834){this['message']=_0x577834||_0x0d8b('0x7');this[_0x0d8b('0x4')]=_0x0d8b('0x7');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x413284){this[_0x0d8b('0x2')]=_0x413284||'Entity\x20not\x20found';this[_0x0d8b('0x4')]=_0x0d8b('0x8');util[_0x0d8b('0x6')](APINotFoundError,APIError);};function getStatusCode(_0x1f4800){switch(_0x1f4800){case _0x0d8b('0x7'):return 0x190;case _0x0d8b('0x9'),_0x0d8b('0xa'):return 0x193;case _0x0d8b('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x48fa16){return function(_0x3c4bfa){logger['error'](_0x3c4bfa[_0x0d8b('0xb')]);var _0xc574a3=getStatusCode(_0x3c4bfa[_0x0d8b('0x4')]);if(_0x3c4bfa[_0x0d8b('0x4')])delete _0x3c4bfa[_0x0d8b('0x4')];return _0x48fa16[_0x0d8b('0xc')](_0xc574a3)[_0x0d8b('0xd')](_0x3c4bfa);};}module[_0x0d8b('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file