Skip to content

Commit

Permalink
fix error handling for helper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
karlprieb authored and djwhitt committed Sep 27, 2024
1 parent 91c3ae5 commit de28367
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/workers/parquet-exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,10 @@ export class ParquetExporter {
minHeight: result[0].min_height,
maxHeight: result[0].max_height,
};
} catch (error) {
throw `Error getting height range for ${tableName}: ${error}`;
} catch (error: any) {
const newError = new Error(`Error getting height range for ${tableName}`);
newError.stack = error.stack;
throw newError;
}
}

Expand All @@ -504,8 +506,12 @@ export class ParquetExporter {
const result = await this.db.all(query);

return result[0].count;
} catch (error) {
throw `Error getting row count for height ${height} in ${tableName}: ${error}`;
} catch (error: any) {
const newError = new Error(
`Error getting row count for height ${height} in ${tableName}`,
);
newError.stack = error.stack;
throw newError;
}
}
}

0 comments on commit de28367

Please sign in to comment.