Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reuse existing error #7421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/rxjs/src/internal/Observable.ts
Expand Up @@ -15,6 +15,7 @@ import type {
ErrorNotification,
NextNotification,
} from './types.js';
import { createInvalidObservableTypeError } from './util/throwUnobservableError.js';

/**
* An error thrown when one or more errors have occurred during the
Expand Down Expand Up @@ -1259,11 +1260,7 @@ export function getObservableInputType(input: unknown): ObservableInputType {
if (isReadableStreamLike(input)) {
return ObservableInputType.ReadableStreamLike;
}
throw new TypeError(
`You provided ${
input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`
} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`
);
throw createInvalidObservableTypeError(input);
}

/**
Expand Down