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

Proper error message when verification fails. #9

Closed
southernsun opened this issue Aug 11, 2016 · 3 comments
Closed

Proper error message when verification fails. #9

southernsun opened this issue Aug 11, 2016 · 3 comments

Comments

@southernsun
Copy link
Contributor

Hi,

the verify task had me dumbfounded for a while as i was checking the results in the db.json errorMessage field and couldn't find anything going wrong. The problem was that the output file had a different extension then the default. Perhaps the "return reject(logs);" can be extended with a clear message that the resulting file couldn't be found with a path to the filename. I was looking how to implement this on my own and provide a changeset, but I didn't quite know what the best solution was to fit in your framework. Probably it is as simple as adding a string to the 'logs' variable. If that's fine with you i could even provide a changeset for merging.

@inlife
Copy link
Owner

inlife commented Aug 12, 2016

Hey,

The problem is that when "output file had a different extension then the default" fs.stat throws an error, which is later handled by first if substatement.

 fs.stat( path.join( 
            project.workpath, 
            project.resultname 
        ), (err, stats) => {
            if (err || !stats || stats.size < 1) {
                getLogs(project, (logs) => {
                    return reject(logs);
                })
          ...

The intention of this piece of code, was to verify that outputted file is the one which we were expecting at the beginning (setting outputExt in project).

But now, i'm thinking: maybe this validation part don't even needed...I don't know.

I was looking how to implement this on my own and provide a changeset

Might be something looking like that:

if (err) {
    return reject(err);
} else if (!stats || stats.size < 1) {
    getLogs(project, (logs) => {
        return reject(logs);
    })
}

@southernsun
Copy link
Contributor Author

Indeed, that might probably be the best way to handle it and provide the user with a more clear error message. Great. Btw, your framework is pretty cool! Thank you for all the effort that you put into it!

@inlife
Copy link
Owner

inlife commented Aug 12, 2016

Implemented this changed in the project, and pushed new version to npm.
And thank you for the feedback. I really appreciate it! ❤️

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