Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert err obj into JSON stringifiable object + update error msg #1376

Merged
merged 1 commit into from
Apr 5, 2021

Conversation

vicky-g
Copy link
Contributor

@vicky-g vicky-g commented Apr 5, 2021

Description

What is the purpose of this PR? What is the current behavior? New behavior? Relevant links (e.g. Trello) and/or information pertaining to PR?

Context: We've been seeing error messages that look like [Object object].
Purpose:

  • This fix is to serialize the error into an object that JSON.stringify() can parse.
  • Also updates the error msg for comparing dir CIDs to include the expected CID

Tests

List the manual tests and repro instructions to verify that this PR works as anticipated. Include log analysis if possible.
❗ If this change impacts clients, make sure that you have tested the clients ❗

Ran mad-dog to encounter error

Before:

Network Error in request 8e033b4c-e336-4c67-8f40-f3ad0d22b080 with 1 retries... retrying
Error: [object Object]
    at CreatorNode._uploadFile (/Users/vickyguan/Documents/audius/audius-protocol/libs/src/services/creatorNode/index.js:688:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)

After:

Network Error in request c0acdb1b-9bdd-4481-b9f0-2da5960654f1 with 1 retries... retrying
Error: {"stack":"Error: Image file validation failed - dirCIDs do not match for dirCID=QmTygvnm5QjCxjr53Bgh6aSwvZUQumFFkF6m9NJD6ZV39i expectedCID=QmPhzRHfy3KGaErjMr8mAfaTcMLfZNet1cCUv5AVtdaFw4\n    at app.post.handleResponseWithHeartbeat (/usr/src/app/src/routes/files.js:414:13)\n    at process._tickCallback (internal/process/next_tick.js:68:7)","message":"Image file validation failed - dirCIDs do not match for dirCID=QmTygvnm5QjCxjr53Bgh6aSwvZUQumFFkF6m9NJD6ZV39i expectedCID=QmPhzRHfy3KGaErjMr8mAfaTcMLfZNet1cCUv5AVtdaFw4"}
    at CreatorNode._uploadFile (/Users/vickyguan/Documents/audius/audius-protocol/libs/src/services/creatorNode/index.js:688:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)

@vicky-g vicky-g merged commit d8f50b7 into master Apr 5, 2021
@vicky-g vicky-g deleted the vg-update-err-handling branch April 5, 2021 21:17
@SidSethi
Copy link
Contributor

SidSethi commented Apr 5, 2021

love this 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants