refactor: reduce number of ErrorKind variants (#3662)

This commit is contained in:
Bartek Iwańczuk 2020-01-20 16:50:16 +01:00 committed by Ry Dahl
parent e83658138b
commit c90036ab88
13 changed files with 61 additions and 224 deletions

View file

@ -12,7 +12,6 @@
// TODO don't disable this warning
import { AbortSignal, QueuingStrategySizeCallback } from "../dom_types.ts";
import { DenoError, ErrorKind } from "../errors.ts";
// common stream fields
@ -208,10 +207,7 @@ export function cloneValue(value: any): any {
default:
// TODO this should be a DOMException,
// https://github.com/stardazed/sd-streams/blob/master/packages/streams/src/shared-internals.ts#L171
throw new DenoError(
ErrorKind.DataCloneError,
"Uncloneable value in stream"
);
throw new Error("Uncloneable value in stream");
}
}