Skip to content

Commit

Permalink
Added error handling when bid suggestion call fails (#2847)
Browse files Browse the repository at this point in the history
  • Loading branch information
djordjekovac authored Dec 25, 2023
1 parent 4c74af0 commit 7ce252e
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,24 @@ class BidSuggestionController extends BaseController {
firstAssertionId,
hashFunctionId,
} = req.query;

this.returnResponse(res, 200, {
bidSuggestion: await this.shardingTableService.getBidSuggestion(
try {
const bidSuggestion = await this.shardingTableService.getBidSuggestion(
blockchain,
epochsNumber,
assertionSize,
contentAssetStorageAddress,
firstAssertionId,
hashFunctionId,
),
});
);

this.returnResponse(res, 200, { bidSuggestion });
} catch (error) {
this.logger.error(`Unable to get bid suggestion. Error: ${error}`);
this.returnResponse(res, 500, {
code: 500,
message: 'Unable to calculate bid suggestion',
});
}
}
}

Expand Down

0 comments on commit 7ce252e

Please sign in to comment.