mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
tweak(server/logging): Added try catch and logging to calls fetch
This commit is contained in:
1 parent
e037a9b0f8
commit
95866cc51c
1 file changed
+14
-7
@@ -187,7 +187,10 @@ onNet(
|
|||||||
// ends animations if call is active
|
// ends animations if call is active
|
||||||
if (currentCall.accepted) {
|
if (currentCall.accepted) {
|
||||||
emitNet(events.PHONE_CALL_SEND_HANGUP_ANIM, currentCall.receiverSource);
|
emitNet(events.PHONE_CALL_SEND_HANGUP_ANIM, currentCall.receiverSource);
|
||||||
emitNet(events.PHONE_CALL_SEND_HANGUP_ANIM, currentCall.transmitterSource);
|
emitNet(
|
||||||
|
events.PHONE_CALL_SEND_HANGUP_ANIM,
|
||||||
|
currentCall.transmitterSource
|
||||||
|
);
|
||||||
}
|
}
|
||||||
calls.delete(transmitterNumber);
|
calls.delete(transmitterNumber);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -200,10 +203,14 @@ onNet(
|
|||||||
|
|
||||||
onNet(events.PHONE_CALL_FETCH_CALLS, async () => {
|
onNet(events.PHONE_CALL_FETCH_CALLS, async () => {
|
||||||
const _source = getSource();
|
const _source = getSource();
|
||||||
const identifier = await getIdentifier(_source);
|
try {
|
||||||
const phoneNumber = await usePhoneNumber(identifier);
|
const identifier = await getIdentifier(_source);
|
||||||
|
const phoneNumber = await usePhoneNumber(identifier);
|
||||||
const calls = await fetchCalls(phoneNumber);
|
const calls = await fetchCalls(phoneNumber);
|
||||||
|
emitNet(events.PHONE_CALL_SEND_HISTORY, _source, calls);
|
||||||
emitNet(events.PHONE_CALL_SEND_HISTORY, _source, calls);
|
} catch (e) {
|
||||||
|
callLogger.error(`Failed to fetch calls, ${e.message}`, {
|
||||||
|
source: _source,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user