-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
When getting archiver stats if the archiver has no cycleinfo it is an empty array and fails with a not very useful error undefined => undefined
When this is most likely to happen is when starting up a local network if you start the RPC before the network is processing you get this error. This could be logged more gracefully
Unreachable Archiver @ 127.0.0.1:4000 | Error-code: undefined => undefined
Lines 223 to 235 in e34f7fb
| const res = await axios.get(`http://${url.ip}:${url.port}/cycleinfo/1`) | |
| if (res?.data?.cycleInfo[0].counter > maxCycleValue) { | |
| maxCycleValue = res?.data?.cycleInfo[0].counter | |
| } | |
| return { url: `http://${url.ip}:${url.port}`, cycle_value: res?.data?.cycleInfo[0].counter } | |
| } catch (error: unknown) { | |
| console.error( | |
| `Unreachable Archiver @ ${url.ip}:${url.port} | Error-code: ${(error as NodeJSError).errno} => ${ | |
| (error as NodeJSError).code | |
| }` | |
| ) | |
| return { url: `http://${url.ip}:${url.port}`, cycle_value: null } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
