Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How are errors handled? #22

Open
jayasrinagrale opened this issue Oct 5, 2017 · 1 comment
Open

How are errors handled? #22

jayasrinagrale opened this issue Oct 5, 2017 · 1 comment

Comments

@jayasrinagrale
Copy link

How are errors handled in this module?

Normally there would be a callback which returns an error... or it would be a promise that resolves or rejects. How does it work in this module?

@tonespy
Copy link

tonespy commented Dec 17, 2017

For errors that occur while reading directories, it's handled manually. But, for errors coming from zipping, and writing to directory, for instance if you look at the writeToFile function you'll see this:

EasyZip.prototype.writeToFile = function(filePath,callback){
		var data = this.generate({base64:false,compression:'DEFLATE'});
		fs.writeFile(filePath, data, 'binary',callback);
}

the callback is passed here fs.writeFile(filePath, data, 'binary',callback)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants