Display full error object all the time regardless of argument position
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- devtools
Research direction
Start with the behavior in src/common.js at the linked line and review the README's debug argument documentation. Check issues #334 and #711 for existing decisions or constraints. Document how Error objects are displayed based on argument position, or clarify the agreed scope if an option is required; the README should accurately describe the resulting behavior.
Written by the indexing model from the issue text.
Description
A quick explanation:
var debug = require('debug')('http');
const error = new Error('hi');
error.info= { display: 'me' };
debug(error) ;
debug('', error); // this will output info object
This is not mentioned in the readme and I had to hunt the reason for this. If an error is the first argument, it will be coerced.
https://github.com/debug-js/debug/blob/f66cb2d9f729e1a592e72d3698e3b75329d75a25/src/common.js#L82
At the very least, this behavior should be documented in the readme.
An option could be added to change this behavior. At first, the option could default to the current behavior and then the default behavior can be changed after a reasonable period.
This issue is related to https://github.com/debug-js/debug/issues/334. This open issue is also related, https://github.com/debug-js/debug/issues/711.
- Dominant language
- JavaScript
- Stars
- 11.5k
- Forks
- 992
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from debug-js/debug
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Debug as JSON Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 28/100
Similar issues
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AllTheMods/ATM-10-L#19 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SignalK/n2k-signalk#345 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
JuliaPluto/PlutoPlotly.jl#72 ·