spesmilo / spesmilo/electrum

better jsonrpc error description - use code numbers

Open
#7,582 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.6k
Forks
3.5k
Avg merge
2d 8h
Merged PRs (30d)
61

Description

What happened?

{
  "id": 1,
  "jsonrpc": "2.0",
  "error": {
    "code": 1,
    "message": "Tato faktura již byla zaplacena"
  }
}

Without knowing my language you have no idea, what happened. Yeah, this error is returned, when lnpay tries to pay already paid invoice. However, apropriate code and description should be used, to able to process the error by a machine (not human).

Code is always 1. I bet that code 1 is unhandled exception error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the JSON-RPC response path used when lnpay attempts to pay an already-paid invoice. Review how the current code and message are selected, then define the machine-readable error-code behavior and verify that the response is no longer dependent on the user's language.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.