Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Display full error object all the time regardless of argument position

Aperta
#958 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
11.5k
Fork
992
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di debug-js/debug

Tutte le issue di debug-js/debug

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.