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

improved error handling #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

part-time-githubber
Copy link

No description provided.

Comment on lines +99 to +102
let stderrData = []
gpg.stderr.on('data', (data) => {
stderrData.push(data);
});
Copy link
Collaborator

@freewil freewil Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to take a closer look at how this streaming func is used, but initial thoughts:

can you rename stderrData to error, rename data to buf and initialize error as an empty string and then change the push so that it appends to error so it is consistent with this:

node-gpg/lib/spawnGPG.js

Lines 28 to 38 in 510c58c

var error = '';
var gpg = spawnIt(gpgArgs, cb);
gpg.stdout.on('data', function (buf){
buffers.push(buf);
buffersLength += buf.length;
});
gpg.stderr.on('data', function(buf){
error += buf.toString('utf8');
});

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

Successfully merging this pull request may close these issues.

2 participants