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 committed Sep 27, 2024
1 parent 8b0fcdf commit 1afc1e9
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 1afc1e9

Please sign in to comment.