Skip to content

Commit e0baa30

Browse files
committed
Better error message.
1 parent dad063a commit e0baa30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/generators/queue.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export default function(initialize) {
66
const dispose = initialize(push);
77

88
if (dispose != null && typeof dispose !== "function") {
9-
throw new Error("invalid dispose");
9+
throw new Error(typeof dispose.then === "function"
10+
? "async initializers are not supported"
11+
: "initializer returned something, but not a dispose function");
1012
}
1113

1214
function push(x) {

0 commit comments

Comments
 (0)