-
Notifications
You must be signed in to change notification settings - Fork 28
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
Handle lack of port more gracefully? #145
Comments
I thought we defaulted to port 80 (for http). Let's have a look at this and see how we're getting into this loop. |
See #103 - we should be accepting port 80 as the default. |
Oh I've just realised, you're explicitly calling That would probably explain why it's not using the default. I guess we could do a better job of just throwing the error once instead of looping, but an error it would be. |
Thinking some more, should we apply 80 if port number is unspecified and warn the user, or exit? |
Just exiting would be unexpected behaviour, IMO. Port numbers are so well-known that I think most people expect applications to have some insight as to their intentions, even when they're not explicitly stated. Notifying the user that 80 is being defaulted to would be reasonable, though. |
I can't seem to be able to replicate this issue using just Shunter. I'm assuming this is an app using shunter that is failing in this manner? That said, the behaviour with shunter itself is quite inconsistent at the moment. For example:
Behaviour 2 is wrong and needs to be corrected. An invalid or incomplete argument string being passed to an app is an error, this is standard behaviour on every UNIX app that I know: Valid argument string:
Invalid argument string:
I'm going to have a go at fixing scenario 2 by making it error out. We can see then how it affects Jon's scenario. |
When an optional parameter like `-p` that requires an argument is used but an argument is not passed, this will cause the app to fail as expected instead of using a random value. For example, port was being set to 3000 instead of the default 5401. This hopefully addresses #145.
When an optional parameter like `-p` that requires an argument is used but an argument is not passed, this will cause the app to fail as expected instead of using a random value. For example, port was being set to 3000 instead of the default 5401. This hopefully addresses #145.
If port is not specified we get a spawn loop. Not great I guess, but not sure if this is a thing to be fixed.
Maybe we should catch this and halt?
The text was updated successfully, but these errors were encountered: