Solution - Error
const source$ = new Observable((observer) => { observer.next(1); observer.next(2); observer.next(3); observer.error(new Error('Out of numbers!')); }); source$.subscribe({ next: console.log, error: console.error, });