mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 22:17:14 +03:00
Add better logging for failed reputation call
This commit is contained in:
@@ -47,10 +47,15 @@ export async function getReputation(userID: UserID): Promise<number> {
|
|||||||
const promise = activeReputationRequests[userID] ?? QueryCacher.get(fetchFromDB, reputationKey(userID));
|
const promise = activeReputationRequests[userID] ?? QueryCacher.get(fetchFromDB, reputationKey(userID));
|
||||||
activeReputationRequests[userID] = promise;
|
activeReputationRequests[userID] = promise;
|
||||||
|
|
||||||
|
try {
|
||||||
const result = await promise;
|
const result = await promise;
|
||||||
|
|
||||||
delete activeReputationRequests[userID];
|
delete activeReputationRequests[userID];
|
||||||
|
|
||||||
return calculateReputationFromMetrics(result);
|
return calculateReputationFromMetrics(result);
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error(`${(e as Error)?.message}\n\n${userID}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert a number from one range to another.
|
// convert a number from one range to another.
|
||||||
|
|||||||
Reference in New Issue
Block a user