Closed Bug 1420577 Opened 7 years ago Closed 7 years ago

Improve failure messages for invalid proxy configurations

Categories

(Remote Protocol :: Marionette, defect)

57 Branch
defect
Not set
normal

Tracking

(firefox58 fixed, firefox59 fixed)

RESOLVED FIXED
mozilla59
Tracking Status
firefox58 --- fixed
firefox59 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

As seen on https://github.com/mozilla/geckodriver/issues/1022#issuecomment-345784282 we fail with:

> "InvalidArgumentError: Expected [object Undefined] undefined to be an integer"

Those messages should include what specifically was wrong. The fix here should apply to probably all the checks we do.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Comment on attachment 8934315 [details]
Bug 1420577 - Improve failure messages for invalid proxy configurations.

https://reviewboard.mozilla.org/r/205236/#review210820

::: testing/marionette/session.js:277
(Diff revision 1)
> +            "Expected \"proxyAutoconfigUrl\" to be a string, " +
> +            pprint`got ${json.proxyAutoconfigUrl}`);

If you use backticks on :277 also you can avoid the quote escaping, which I think would be preferable.
Attachment #8934315 - Flags: review?(ato) → review+
Comment on attachment 8934315 [details]
Bug 1420577 - Improve failure messages for invalid proxy configurations.

https://reviewboard.mozilla.org/r/205236/#review210820

> If you use backticks on :277 also you can avoid the quote escaping, which I think would be preferable.

In a different patch you didn't want to have backticks because no variable substituation has been taken place. Now it's vice versa. I will make this change given that I also find it looks better.
(In reply to Henrik Skupin (:whimboo) from comment #3)

> > If you use backticks on :277 also you can avoid the quote
> > escaping, which I think would be preferable.
> 
> In a different patch you didn't want to have backticks because
> no variable substituation has been taken place. Now it's vice
> versa. I will make this change given that I also find it looks
> better.

I think maybe you misunderstand.  Template strings are there to
make code more beautiful but according to JS developers I have
talked to they are not JITed and can therefore be slower to use than
regular quoted strings.  From that I conclude that they shouldn’t be
over-used when there is no need, but if using them makes code more
readable, I know which option I would pick.
Comment on attachment 8934419 [details]
Bug 1420577 - Add template literals to eslint max-len ignore list.

https://reviewboard.mozilla.org/r/205340/#review210984
Attachment #8934419 - Flags: review?(ato) → review+
(In reply to Andreas Tolfsen ‹:ato› from comment #6)
> I think maybe you misunderstand.  Template strings are there to
> make code more beautiful but according to JS developers I have
> talked to they are not JITed and can therefore be slower to use than
> regular quoted strings.  From that I conclude that they shouldn’t be

That one I didn't know. Thanks for the details. Maybe the slowness doesn't apply if no variable substitution takes place in the template string? Do you know about that?
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/732efd9df3ec
Add template literals to eslint max-len ignore list. r=ato
https://hg.mozilla.org/integration/autoland/rev/2101004c5245
Improve failure messages for invalid proxy configurations. r=ato
(In reply to Henrik Skupin (:whimboo) from comment #8)

> (In reply to Andreas Tolfsen ‹:ato› from comment #6)
> 
> > I think maybe you misunderstand.  Template strings are there to
> > make code more beautiful but according to JS developers I have
> > talked to they are not JITed and can therefore be slower to use
> > than regular quoted strings.  From that I conclude that they
> > shouldn’t be
> 
> That one I didn't know. Thanks for the details. Maybe the slowness
> doesn't apply if no variable substitution takes place in the
> template string? Do you know about that?

I think that is a good guess, but I don’t have first hand proof of
that.

In any case, I was just making a suggestion to avoid having quoted
strings inside strings.
https://hg.mozilla.org/mozilla-central/rev/732efd9df3ec
https://hg.mozilla.org/mozilla-central/rev/2101004c5245
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Those minor wording changes for failures in capabilities for proxy settings will greatly improve the handling in geckodriver. Please uplift those test harness changes to beta. Thanks.
Whiteboard: [checkin-needed-beta]
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: