digitalbazaar / digitalbazaar/webkms-client

More descriptive errors for edge cases

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

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
6
Forks
4
PR merge metrics
No merged PRs in 30d

Description

If the network infrastructure around a deployed webmks system is such that there are valid cases where a response with a status code other than 200 (or 400/500) is received, this should be caught and a descriptive error message originating in KmsClient should be thrown.

For instance, if a 302 is sent back in the response to getKeyDescription, there will be an empty or otherwise unexpected body for the subsequent methods to use, leading to uncaught errors being bubbled up. In this cause, when attempting to destructure id and type.

https://github.com/digitalbazaar/webkms-client/blob/ab315d411dd3d581803fafe3a9b4f2fd07bf55cc/lib/KeyAgreementKey.js#L86-L91

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 with KmsClient and lib/KeyAgreementKey.js around lines 86-91, then trace the getKeyDescription response handling. Reproduce a response with a status other than 200, 400, or 500 and ensure it produces a descriptive KmsClient error instead of an uncaught destructuring failure.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.