try/catch
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 39s Details

This commit is contained in:
Ladd Hoffman 2024-05-02 14:00:56 -05:00
parent 01cf630a20
commit 9c95e813a2
1 changed files with 7 additions and 3 deletions

View File

@ -31,9 +31,7 @@ const stakeRollupAvailability = async () => {
const getBatchPostAuthorWeights = async (batchItems_) => {
const weights = {};
await Promise.each(batchItems_, async (postId) => {
// TODO: try/catch
const post = await read(postId);
// TODO: try/catch
const matrixPool = await matrixPools.get(postId);
const { fee, result: { votePasses, quorumMet } } = matrixPool;
post.authors.forEach(({ authorAddress, weightPPM }) => {
@ -164,7 +162,13 @@ const start = async () => {
if (!post.embeddedData?.matrixPools) return false;
// Our task here is to check whether the posted result agrees with our own computations
const expectedAuthors = await getBatchPostAuthorWeights(post.embeddedData.matrixPools);
let expectedAuthors;
try {
expectedAuthors = await getBatchPostAuthorWeights(post.embeddedData.matrixPools);
} catch (e) {
console.error('Error calculating batch post author weights', e);
return false;
}
return authorsMatch(post.authors, expectedAuthors);
});