Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.

Commit 6566a55

Browse files
committed
Emit parser errors on fragment.
The page is a source of the parser iterator, so any error emitted on the page (source) would be re-emitted on the parser (destination) by AsyncIterator. Therefore, an endless loop occurs if the parser in turn bounces errors back to the page. Instead, the parser should emit them on the fragment, because the fragment reads from the parser.
1 parent 96e06e0 commit 6566a55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/triple-pattern-fragments/FragmentsClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Fragment.prototype.loadFromUrl = function (pageUrl) {
166166
// Load the next page, or end if none was found
167167
nextPage ? fragment.loadFromUrl(nextPage) : fragment.close();
168168
}
169-
parsedPage.on('error', function (error) { page.emit('error', error); });
169+
parsedPage.on('error', function (error) { fragment.emit('error', error); });
170170

171171
// A new page of data has been loaded, so this fragment is readable again
172172
fragment.readable = true;

0 commit comments

Comments
 (0)