QuantConnect / QuantConnect/Lean.Brokerages.Coinbase

Improve Error Message for Invalid Credentials

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
5
Forks
14
Avg merge
9h 29m
Merged PRs (30d)
2

Description

Similar to https://github.com/QuantConnect/Lean.Brokerages.Coinbase/issues/16

Expected Behavior

401 Unauthorized explain that credentials are invalid.

Actual Behavior

We receive the following message which doesn't explain 401:

During the algorithm initialization, the following exception has occurred: Error getting cash balance from brokerage: CoinbaseApiClient.ExecuteRequest failed: [401] Unauthorized, Content: Unauthorized
Potential Solution

If the error code is 401. Ask user to verify credentials.
API Private Key is tricky since members need to remove \n which might lead to human error.

Reproducing the Problem

Deploy with old/invalid credentials.

Checklist
  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

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 at CoinbaseApiClient.ExecuteRequest and reproduce the failure with old or invalid credentials. Trace how the 401 response becomes the initialization exception, then make the resulting message explain that credentials may be invalid and mention the private-key newline concern. Done means the invalid-credential scenario gives actionable guidance instead of only “Unauthorized”.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.