`Error: ENOENT, No such file or directory` when db doesn't already exist.
- Lingua principale
- JavaScript
- Stelle
- 619
- Fork
- 64
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.