From 7953f112faf19c5485537bf979af19c735b40e24 Mon Sep 17 00:00:00 2001 From: Gabriel Fosse Date: Fri, 12 Apr 2024 13:19:38 -0700 Subject: [PATCH] catch errors in stringStream --- src/adapters/arpalazio.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/adapters/arpalazio.js b/src/adapters/arpalazio.js index c92b34a2..6c599adb 100644 --- a/src/adapters/arpalazio.js +++ b/src/adapters/arpalazio.js @@ -158,6 +158,9 @@ export const getStream = function ( const stations = {}; return StringStream.from(getter.stream(url)) .lines(StringStream.SPLIT_LINE) + .catch((error) => { + log.error('Stream error: ', error); + }) .map((x) => x.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '')) .parse((row) => row.trim().split(/\s+/g)) .shift(1, ([header]) => {