Bug 238737 - webkitpy.w3c.test_exporter assumes all exceptions are HTTPError
Summary: webkitpy.w3c.test_exporter assumes all exceptions are HTTPError
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Sneddon [:gsnedders]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-04 07:24 PDT by Sam Sneddon [:gsnedders]
Modified: 2022-04-11 15:58 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.04 KB, patch)
2022-04-04 07:42 PDT, Sam Sneddon [:gsnedders]
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2022-04-04 07:24:30 PDT
This is the second exception in bug 238735:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/antti/webkit/OpenSource/Tools/Scripts//webkit-patch", line 80, in <module>
    main()
  File "/Users/antti/webkit/OpenSource/Tools/Scripts//webkit-patch", line 75, in main
    WebKitPatch(os.path.abspath(__file__)).main()
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 305, in main
    result = command.check_arguments_and_execute(options, args, self)
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/multicommandtool.py", line 123, in check_arguments_and_execute
    return self.execute(options, args, tool) or 0
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py", line 55, in execute
    self._sequence.run_and_handle_errors(tool, options, state)
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/commands/stepsequence.py", line 73, in run_and_handle_errors
    self._run(tool, options, state)
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/commands/stepsequence.py", line 67, in _run
    step(tool, options).run(state)
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/tool/steps/wptchangeexport.py", line 53, in run
    test_exporter.do_export()
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 397, in do_export
    self.make_pull_request()
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 336, in make_pull_request
    pr_number = self.create_wpt_pull_request(self._wpt_fork_remote + ':' + self._public_branch_name, self._commit_message, description)
  File "/Users/antti/webkit/OpenSource/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 352, in create_wpt_pull_request
    if e.code == 422:
AttributeError: 'TypeError' object has no attribute 'code'

Essentially, we seem to be assuming we always have a code attribute (which urllib.error.HTTPError has), but catching every exception.
Comment 1 Sam Sneddon [:gsnedders] 2022-04-04 07:42:22 PDT
Created attachment 456569 [details]
Patch

This I think would fix it, but there's no easy way to test this currently, short of exporting something.
Comment 2 Radar WebKit Bug Importer 2022-04-11 07:25:15 PDT
<rdar://problem/91563799>
Comment 3 Sam Sneddon [:gsnedders] 2022-04-11 14:44:01 PDT
Comment on attachment 456569 [details]
Patch

Let's just land this because from a basic review it's obvious that it shouldn't make anything worse.
Comment 4 EWS 2022-04-11 15:57:59 PDT
Committed r292731 (249516@main): <https://commits.webkit.org/249516@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456569 [details].