Skip to content

Commit

Permalink
catch errors in stringStream
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Fosse committed Apr 12, 2024
1 parent 6f60e06 commit 7953f11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/adapters/arpalazio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]) => {
Expand Down

0 comments on commit 7953f11

Please sign in to comment.