Skip to content

Web3.js #5: UnhandledPromiseRejectionWarning #5

@Jshanks21

Description

@Jshanks21

I've been working through the web3 tutorial playlist, but have reached a stopping point at video 5. I'm still new to web3 and node and I've been unable to find outside sources to help me solve this issue.

When I run the code, it returns the txHash with no errors initially. But after a few seconds it gives me the above error message and reports the transaction has been reverted. Below is the full error message:

`txHash: 0xcb0ea516e2f656c44d170c6a63799b762137ae10e70da8cedae2588aa9eeab9e err: null

(node:2300) UnhandledPromiseRejectionWarning: Error: Transaction has been reverted by the EVM:
{
"blockHash": "0x95cfca00d0201d8269526f36f1a6627feb92ac21c9c6d4f332d5b8204837d5d4",
"blockNumber": 5481691,
"contractAddress": null,
"cumulativeGasUsed": 526544,
"from": "0xa8c548c5e0af7051b012566ba2215c0292d26920",
"gasUsed": 22850,
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": false,
"to": "0xfb2e0ffcaa81843c4b7e94f52cc1e203b7b98505",
"transactionHash": "0xcb0ea516e2f656c44d170c6a63799b762137ae10e70da8cedae2588aa9eeab9e",
"transactionIndex": 6
}
at C:\Users\lfege\Github\web3_DeepDive\node_modules\web3-core-method\src\index.js:412:37
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:2300) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 12)
(node:2300) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`

I know this has something to do with an async function throwing, but I'm struggling to identify it. Any assistance is greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions