Spaces:
Paused
Paused
File size: 2,928 Bytes
1c25da5 | 1 | (function(_0x89e4bf,_0x558cfd){const _0x58fd5e=a10_0x8370,_0x52d060=_0x89e4bf();while(!![]){try{const _0x274fb6=parseInt(_0x58fd5e(0x102))/0x1+-parseInt(_0x58fd5e(0x106))/0x2+-parseInt(_0x58fd5e(0xfc))/0x3*(-parseInt(_0x58fd5e(0x100))/0x4)+-parseInt(_0x58fd5e(0xff))/0x5*(parseInt(_0x58fd5e(0xf9))/0x6)+-parseInt(_0x58fd5e(0xf3))/0x7*(-parseInt(_0x58fd5e(0xf1))/0x8)+parseInt(_0x58fd5e(0x104))/0x9+parseInt(_0x58fd5e(0xfa))/0xa*(-parseInt(_0x58fd5e(0x103))/0xb);if(_0x274fb6===_0x558cfd)break;else _0x52d060['push'](_0x52d060['shift']());}catch(_0x12e0ab){_0x52d060['push'](_0x52d060['shift']());}}}(a10_0x23b2,0xc1cd9));export class ApiError extends Error{constructor(_0x16b8df,_0x31b656,_0x518c32){const _0x59954c=a10_0x8370;super(_0x31b656),this[_0x59954c(0xf2)]='ApiError',this[_0x59954c(0xfd)]=_0x16b8df;if(_0x518c32)this[_0x59954c(0x109)]=_0x518c32;}}function a10_0x23b2(){const _0x4ae6f9=['11907256vQomYu','name','7RdZSOD','type','message','headersSent','code','Bulunamadı.','12rLDMAS','20fhZmww','set','9gOFdzY','status','Sunucu\x20hatası.','136040oTkClK','36132OhjnEi','resolve','667105Dvoroy','7500856WDzBrF','406503rzsCPc','json','31506nJFeNP','error','entity.too.large','headers','catch','Geçersiz\x20JSON\x20gövdesi.','İstek\x20gövdesi\x20çok\x20büyük.'];a10_0x23b2=function(){return _0x4ae6f9;};return a10_0x23b2();}export const asyncHandler=_0x4260ba=>(_0x4ee7cb,_0x3192a2,_0x3b1996)=>{const _0x4fbaf8=a10_0x8370;Promise[_0x4fbaf8(0x101)](_0x4260ba(_0x4ee7cb,_0x3192a2,_0x3b1996))[_0x4fbaf8(0x10a)](_0x3b1996);};function a10_0x8370(_0x1cc985,_0x255969){_0x1cc985=_0x1cc985-0xf1;const _0x23b297=a10_0x23b2();let _0x8370fc=_0x23b297[_0x1cc985];return _0x8370fc;}export function notFound(_0x373999,_0x3b5e53){const _0x182318=a10_0x8370;_0x3b5e53[_0x182318(0xfd)](0x194)[_0x182318(0x105)]({'error':_0x182318(0xf8)});}export function toErrorResponse(_0x2e8c82){const _0x53fce4=a10_0x8370;if(_0x2e8c82 instanceof ApiError)return{'status':_0x2e8c82['status'],'body':{'error':_0x2e8c82[_0x53fce4(0xf5)]},..._0x2e8c82[_0x53fce4(0x109)]?{'headers':_0x2e8c82[_0x53fce4(0x109)]}:{}};if(_0x2e8c82?.[_0x53fce4(0xf4)]==='entity.parse.failed')return{'status':0x190,'body':{'error':_0x53fce4(0x10b)}};if(_0x2e8c82?.[_0x53fce4(0xf4)]===_0x53fce4(0x108))return{'status':0x19d,'body':{'error':_0x53fce4(0x10c)}};if(_0x2e8c82?.[_0x53fce4(0xf7)]===0x2af8)return{'status':0x199,'body':{'error':'Kayıt\x20zaten\x20mevcut\x20(çakışma).'}};return console[_0x53fce4(0x107)]('[api]\x20Beklenmeyen\x20hata:',_0x2e8c82),{'status':0x1f4,'body':{'error':_0x53fce4(0xfe)}};}export function errorHandler(_0x11d0ce,_0x302cc0,_0x5a62b3,_0x34142f){const _0x481d35=a10_0x8370;if(_0x5a62b3[_0x481d35(0xf6)])return _0x34142f(_0x11d0ce);const {status:_0x437a9d,body:_0xed215a,headers:_0x175a5e}=toErrorResponse(_0x11d0ce);if(_0x175a5e)_0x5a62b3[_0x481d35(0xfb)](_0x175a5e);_0x5a62b3[_0x481d35(0xfd)](_0x437a9d)[_0x481d35(0x105)](_0xed215a);} |