Fmstrat / Fmstrat/lcs

LCS restarts when running into a FetchError.

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
66
Forks
6
PR merge metrics
No merged PRs in 30d

Description

When a remote instance can't be reached or returns invalid json, LCS continually restarts instead of skipping the instance it can't reach.

```
Checking lemmy.sdf.org for posts of Hot

/app/node_modules/node-fetch/lib/index.js:1505
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
^
FetchError: request to https://lemmy.sdf.org/api/v3/post/list?type_=All&sort=Hot&limit=50 failed, reason: connect ECONNREFUSED 205.166.94.11:443
at ClientRequest. (/app/node_modules/node-fetch/lib/index.js:1505:11)
at ClientRequest.emit (node:events:511:28)
at TLSSocket.socketErrorListener (node:_http_client:495:9)
at TLSSocket.emit (node:events:511:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED'
}

Node.js v20.3.1

> lemmy-subscriber@1.0.0 start
> node index.js
```

```
Checking lemmy.world for posts of TopDay

/app/node_modules/node-fetch/lib/index.js:273
return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
^
FetchError: invalid json response body at https://lemmy.world/api/v3/post/list?type_=All&sort=TopDay&limit=50 reason: Unexpected token '<', "
lemmy-subscriber@1.0.0 start
> node index.js
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.