Skip to content

Commit

Permalink
better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Nov 30, 2023
1 parent 0ba1de4 commit c2d83fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/convertToChartData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function appendForecast(
(d: ChartSection) => d.section == incompleteSection.key,
);

if (!relatedSections) return;
if (!relatedSections.length) return;

const reference: number =
unlocked.length > 0 ? unlocked[unlocked.length - 1] : 0;
Expand Down Expand Up @@ -232,6 +232,11 @@ function appendForecast(
incompleteSection.lastRecord = err
? null
: timestamp + INCOMPLETE_SECTION_STEP;

if (err)
throw new Error(
`error in ${incompleteSection.key}, probably RPC related!!!`,
);
}
function findPreviouslyEmitted(
relatedSections: ChartSection[],
Expand Down

0 comments on commit c2d83fd

Please sign in to comment.