Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

fix: return submit errors with context information #83

Merged
merged 7 commits into from
Feb 6, 2024

Conversation

arkadiuszos4chain
Copy link
Contributor

Current implementation returns misleading error messages from SubmitTx eg:

2024/02/01 20:08:25 error: server responded with no-success code. details: { statusCode: 404, body: "no results"
 }

which suggests Arc node responded with the error.

Proposed solution formats message and extends error information with context:

2024/02/01 19:55:52 error: SubmitTransaction: submiting failed
        inner error: rawTxRequest: updateUtxoWithMissingData() failed
                inner error: junglebus request failed: server responded with no-success code. details: { statusCode: 404, body: "no results"
 }

Pull Request Checklist

  • 📖 I created my PR using provided : CODE_STANDARDS
  • 📖 I have read the short Code of Conduct: CODE_OF_CONDUCT
  • 🏠 I tested my changes locally.
  • ✅ I have provided tests for my changes.
  • 📝 I have used conventional commits.
  • 📗 I have updated any related documentation.
  • 💾 PR was issued based on the Github or Jira issue.

@arkadiuszos4chain arkadiuszos4chain requested a review from a team as a code owner February 1, 2024 19:14
Copy link
Contributor

@chris-4chain chris-4chain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I really like this approach :)

My thoughts:

  • I found another place where is might be wrapped as you proposed: function parseArcError.
  • I'm only wondering, how the indentations will be parsed/treated by log collecting apps like elasticsearch/kibana.

broadcast/internal/outter_errors.go Outdated Show resolved Hide resolved
broadcast/internal/outter_errors.go Outdated Show resolved Hide resolved
broadcast/internal/outter_errors.go Outdated Show resolved Hide resolved
Nazarii-4chain
Nazarii-4chain previously approved these changes Feb 2, 2024
dorzepowski
dorzepowski previously approved these changes Feb 6, 2024
@arkadiuszos4chain arkadiuszos4chain merged commit 04e4448 into main Feb 6, 2024
2 checks passed
@arkadiuszos4chain arkadiuszos4chain deleted the fix-000-return-real-errors branch February 6, 2024 06:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants