a8m / a8m/doqmentdb

Augment the Error object with properties that explain details

Aperta
#32 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
PRs plz!
Lingua principale
JavaScript
Stelle
51
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I am catching an error and sending a response with Express + DoqmentDB like this:

```
foo.create({
foo: bar
}).then(function () {
res.json("Success");
}).catch(function (err) {
res.status(500).json(err);
});
```

The object is just:

```
[Error: Invalid value in: `foo`]
```

What I would like to see is something similar to [this section in the developers/node/design](https://www.joyent.com/developers/node/design/errors#4-augment-the--code-error--code--object-with-properties-that-explain-details) guide, where the error object is augmented with a name, message and the stack trace.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Look at the error handling in the DoqmentDB client, likely in the main module or a dedicated error file. The issue references the Joyent error design guide; start by understanding how errors are currently created and thrown. The goal is to augment error objects with properties like name, message, and stack trace, similar to the guide. Check existing tests for error handling to see the expected format and add new tests for the augmented error properties.

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

Valutazione

Stack tecnologico
javascript, node.js
Ambito
backend, databases
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.