Skip to content

Commit

Permalink
Use getColumnOrThrow in AggregationFrame to improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdemartini committed Dec 21, 2020
1 parent f9632da commit 64d8032
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/data-mate/src/aggregation-frame/AggregationFrame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,7 @@ export class AggregationFrame<
name: keyof T,
type: FieldType
} {
const col = this.getColumn(field);
if (!col) throw new Error(`Unknown column named "${field}"`);
const col = this.getColumnOrThrow(field);

if (as) {
const columns: Column<any, keyof T>[] = [];
Expand Down

0 comments on commit 64d8032

Please sign in to comment.