When a network request receives a non-200 response from the cross-platform client, the error returned is not helpful and doesn't indicate the response code that was received. Debugging these issues would be much easier if we returned the response code.
Error thrown at:
https://github.com/StardustCollective/dag4.js/blob/main/packages/dag4-core/src/cross-platform/clients/fetch.http.ts#L62
Example current error output:
/project/node_modules/@stardust-collective/dag4-core/src/cross-platform/clients/fetch.http.ts:70
throw new Error(text);
^
Error
at FetchRestService.<anonymous> (/project/node_modules/@stardust-collective/dag4-core/src/cross-platform/clients/fetch.http.ts:70:19)
at Generator.next (<anonymous>)
at fulfilled (/project/node_modules/@stardust-collective/dag4-core/dist/cjs/cross-platform/clients/fetch.http.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Expected output example:
/project/node_modules/@stardust-collective/dag4-core/src/cross-platform/clients/fetch.http.ts:70
throw new Error(text);
^
Network Error Response
url: https://be-mainnet.constellationnetwork.io/cluster/info
responseCode: 400
message: Invalid parameter
at FetchRestService.<anonymous> (/project/node_modules/@stardust-collective/dag4-core/src/cross-platform/clients/fetch.http.ts:70:19)
at Generator.next (<anonymous>)
at fulfilled (/project/node_modules/@stardust-collective/dag4-core/dist/cjs/cross-platform/clients/fetch.http.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
When a network request receives a non-200 response from the cross-platform client, the error returned is not helpful and doesn't indicate the response code that was received. Debugging these issues would be much easier if we returned the response code.
Error thrown at:
https://github.com/StardustCollective/dag4.js/blob/main/packages/dag4-core/src/cross-platform/clients/fetch.http.ts#L62
Example current error output:
Expected output example: