From 39949993066bc7265aa1bd069afa0c45b97e143d Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 28 Mar 2022 10:05:09 +0000 Subject: [PATCH] specific invalid state reasons --- src/report/ReportPoll.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/report/ReportPoll.ts b/src/report/ReportPoll.ts index 8e0b952..7ed90ff 100644 --- a/src/report/ReportPoll.ts +++ b/src/report/ReportPoll.ts @@ -68,7 +68,7 @@ export class ReportPoll { 60_000 // a minute in milliseconds ); } else { - throw new InvalidStateError(); + throw new InvalidStateError("cannot start an already started poll"); } } public stop() { @@ -76,7 +76,7 @@ export class ReportPoll { clearInterval(this.interval); this.interval = null; } else { - throw new InvalidStateError(); + throw new InvalidStateError("cannot stop a poll that hasn't started"); } } }