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

Errors not being displayed. #3

Open
melinath opened this issue Apr 12, 2017 · 3 comments · Fixed by graphql/graphql-js#1748
Open

Errors not being displayed. #3

melinath opened this issue Apr 12, 2017 · 3 comments · Fixed by graphql/graphql-js#1748

Comments

@melinath
Copy link

I'm using this as described in the README but errors are not being displayed. My code:

suite.on('cycle', function(event) {
	if (event.target.error) {
		console.log(event.target.error)
	}
	beautifyBenchmark.add(event.target)
})

suite.on('complete', function() {
	beautifyBenchmark.log()
})

The console.log is printing out the errors, but beautify-benchmark never does.

@melinath
Copy link
Author

Okay, so it looks like the problem is that if a runtime error happens it's an instance of Error, which has non-enumerable properties. i.e. Using Object.keys() returns an empty array whereas Object.getOwnPropertyNames() returns an actually useful list.

@melinath
Copy link
Author

Arguably though this should just be rendering the stack trace (which includes the error message) rather than displaying a comma-separated list of all the attributes.

@melinath
Copy link
Author

Workaround for now:

suite.on('cycle', function(event) {
	if (event.target.error) {
		event.target.error = {
			stack: event.target.error.stack,
		}
	}
	beautifyBenchmark.add(event.target)
})

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 a pull request may close this issue.

1 participant