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

NightmareJS raises inconsistent errors #1088

Closed
rinogo opened this issue Apr 13, 2017 · 12 comments
Closed

NightmareJS raises inconsistent errors #1088

rinogo opened this issue Apr 13, 2017 · 12 comments

Comments

@rinogo
Copy link

rinogo commented Apr 13, 2017

In different situations, NightmareJS seems to raise unique/inconsistent errors. It would be much more useful to have a consistent error data structure.

Some examples of different errors I've received:

Nice format, all fields have non-empty values

{ message: 'navigation error',
  code: -7,
  details: 'Navigation timed out after 1000 ms',
  url: 'https://example.com' }

Empty details

{ message: 'navigation error',
  code: -3,
  details: '',
  url: 'https://example.com' }

Non-friendly details

{ message: 'navigation error',
  code: -105,
  details: 'ERR_NAME_NOT_RESOLVED',
  url: 'https://non-existent-website-nifgeoawniogea.com/' }

Different data structure

[Error: .wait() timed out after 1000msec]

With these different error structures, I've had to write a .catch() call that handles the various nuanced differences.

If we could always expect all fields to be present and non-empty, our .catch() calls could be very simple. Example:

.catch(function (error) {
	console.error({"status": "error", "details": error.details});
});
@rinogo
Copy link
Author

rinogo commented Apr 13, 2017

Also, if it helps anyone, here's the .catch() block I'm currently using. It works for the error messages I've encountered, but likely should be extended further.

@entrptaher
Copy link
Contributor

I vote for the same. Navigation error code -3 is not helpful at all.

{ message: 'navigation error',
code: -3,
details: '',
url: 'http://example.com' }

@nlack
Copy link

nlack commented Jun 1, 2017

yeah, it really sucks.

@Khady
Copy link

Khady commented Jun 2, 2017 via email

@rinogo
Copy link
Author

rinogo commented Jun 2, 2017

@Khady Could be! Regardless:

  1. The message/details could be improved to be a lot more helpful.
  2. The formatting of the various errors generated by NightmareJS should be more predictable. The same data structure should be used throughout, and a helpful message and/or details should be included with each error.

@Auxilinaut
Copy link

I'm glad to see I'm not the only one with this sort of problem. Code -3 is popping up about 90% of the time for this project I'm on and the other 10% it just... works perfectly fine. I am using Cloud9 with NightmareJS in headless mode however, so I will attempt to run my script locally and have it show what's going on.

@casesandberg
Copy link

Does anyone have some time to throw together a PR for this? I would be happy to take a look at it. I am going to close this, but feel free to open a new issue if you get a chance to work on it.

@perry-mitchell
Copy link

perry-mitchell commented Aug 25, 2017

Sorry @casesandberg, but why close this issue if this is an outstanding problem? Even if it's not easily solved through nightmare, isn't it better to recognise this as a reoccurring problem?

I too am seeing this issue about 5-10% of runs with {show: true}. It happens for colleagues running linux/osx machines and on a variety of target URLs.

@entrptaher
Copy link
Contributor

@casesandberg, I agree, why are you closing this issue if it was never solved? Same goes with some of other issues, are you just going around closing issues so we can create same issues again?

It happens to me all the time with random websites where the requests are suddenly aborted on some part of the page. So far I .catch() and ignore -3 code, but we don't have anyone who can provide us with some more helpful indepth data.

@rinogo
Copy link
Author

rinogo commented Aug 25, 2017

@perry-mitchell and @entrptaher - I feel like this is standard practice amongst many OS projects... Have you seen the "Won't Fix" tag on other source management/bug reporting systems? At times I feel like closing out issues is a maintainer's way of saying, "bug or not, I'm not going to fix this". Kind of a bummer. Oh well - what can you do except perhaps contribute a fix yourself?... If this is a high priority fix for you, I bet you could expedite its resolution by sending @casesandberg a few 💰, 🍺, or ☕️. 😄

@perry-mitchell
Copy link

perry-mitchell commented Aug 28, 2017

Since a colleague added a preload script to nightmare, we haven't seen this issue since. Here's hoping it stays gone.

@rinogo Of course, you're right there.. However this issue was closed without any meaningful action (including "Won't Fix"), which is what I was getting at. It is a high priority for myself, but if the maintainers won't acknowledge it as an important bug I must admit it's a bit off-putting in terms of contributing. Of course if I happen to find a solution while working with Nightmare I'll definitely create a PR.

@rinogo
Copy link
Author

rinogo commented Aug 28, 2017

@perry-mitchell I hear ya! Maintenance on OS projects is understandably a challenge for users/contributors and maintainers alike. Thanks for providing that preload script, by the way! :)

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

No branches or pull requests

7 participants