kaiachain / kaia

GNU Lesser General Public License v3.0
21 stars 27 forks source link

Improve error message for upstream request #140

Closed hyeonLewis closed 5 days ago

hyeonLewis commented 5 days ago

Proposed changes

This PR suggests to show the error comes from the upstream archive EN, not itself.

// Before
> kaia.getBalance("0x0d019776cf279ba6a0d93bf63c83ab1104287008", "23")
Error: the header does not exist (block number: 23)
    at web3.js:6814:9(39)
    at send (web3.js:5225:62(29))
    at <eval>:1:16(4)
// After
> kaia.getBalance("0x0d019776cf279ba6a0d93bf63c83ab1104287008", "23")
Error: from upstream archive en: the header does not exist (block number: 23)
    at web3.js:6814:9(39)
    at send (web3.js:5225:62(29))
    at <eval>:1:16(4) (edited) 

Types of changes

Please put an x in the boxes related to your change.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Related issues

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...