Skip to content

Commit

Permalink
feat: fromValues throws when measurement missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sciator committed Sep 12, 2023
1 parent c8f3a18 commit 52a608c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/client/src/Point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export class Point {
}

public static fromValues(values: PointValues): Point {
if (!values.getMeasurement() || values.getMeasurement() === '') {
throw new Error('cannot convert values to point without measurement set!')
}
return new Point(values)
}

Expand Down

0 comments on commit 52a608c

Please sign in to comment.