felixge / felixge/node-dirty

`Error: ENOENT, No such file or directory` when db doesn't already exist.

Abierto
#16 5 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
JavaScript
Estrellas
619
Forks
64
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Currently, `dirty` throws an error when called with a file that does not exist. It still creates the file, though, so that subsequent attempts are successful.

Example:

```
var Dirty = require( "dirty" )
, path = require( "path" )
, real = "real.db"
, imaginary = "imaginary.db"

require( "fs" ).writeFileSync( real, "" )

process.on( "uncaughtException", function( err ) {
console.log( "Caught exception: " + err )
});

path.exists( real, function( exists ) {
console.log( real + " exists? " + exists )
})

path.exists( imaginary, function( exists ) {
console.log( imaginary + " exists? " + exists )
})

Dirty( "real.db" )
Dirty( "imaginary.db" )

path.exists( real, function( exists ) {
console.log( real + " exists? " + exists )
})

path.exists( imaginary, function( exists ) {
console.log( imaginary + " exists? " + exists )
})
```

which outputs:

```
$ node dirty.js
real.db exists? true
imaginary.db exists? false
Caught exception: Error: ENOENT, No such file or directory 'imaginary.db'
real.db exists? true
imaginary.db exists? true
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.