)]}'
{"networking_odl/common/websocket_client.py":[{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"6226eb2a43066e812de637732df532fcf90c47f0","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        except ValueError:"},{"line_number":240,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":241,"context_line":"                LOG.error(\"websocket create connection invalid URL\")"},{"line_number":242,"context_line":"        except websocket.WebSocketBadStatusException:"},{"line_number":243,"context_line":"            LOG.error(\"webSocket bad status exception\", exc_info\u003dTrue)"},{"line_number":244,"context_line":"            return None"},{"line_number":245,"context_line":"        except Exception:"},{"line_number":246,"context_line":"            LOG.exception(\"websocket create connection failed\","},{"line_number":247,"context_line":"                          exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_2e8b15c3","side":"PARENT","line":244,"range":{"start_line":242,"start_character":8,"end_line":244,"end_character":23},"updated":"2017-08-31 06:56:54.000000000","message":"Don\u0027t remove this, instead make the except conditional to the existence of the exception. If it doesn\u0027t exist, fallback to the exception that was thrown before the existence of `websocket.WebSocketBadStatusException` and catch that.","commit_id":"5e2db97a46cb8fa64115c584b0907e88c05f0647"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f74afc9fa764dd080cb1509231b97905cb40e108","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        except ValueError:"},{"line_number":240,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":241,"context_line":"                LOG.error(\"websocket create connection invalid URL\")"},{"line_number":242,"context_line":"        except websocket.WebSocketBadStatusException:"},{"line_number":243,"context_line":"            LOG.error(\"webSocket bad status exception\", exc_info\u003dTrue)"},{"line_number":244,"context_line":"            return None"},{"line_number":245,"context_line":"        except Exception:"},{"line_number":246,"context_line":"            LOG.exception(\"websocket create connection failed\","},{"line_number":247,"context_line":"                          exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_f1e4d03d","side":"PARENT","line":244,"range":{"start_line":242,"start_character":8,"end_line":244,"end_character":23},"in_reply_to":"7f287b81_2e8b15c3","updated":"2017-08-31 07:15:05.000000000","message":"I don\u0027t think this necessary. It doesn\u0027t add any better error handling or logging. Simply not worth the complexity/effort if you ask me. See my next response as well.","commit_id":"5e2db97a46cb8fa64115c584b0907e88c05f0647"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"6226eb2a43066e812de637732df532fcf90c47f0","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        except websocket.WebSocketBadStatusException:"},{"line_number":243,"context_line":"            LOG.error(\"webSocket bad status exception\", exc_info\u003dTrue)"},{"line_number":244,"context_line":"            return None"},{"line_number":245,"context_line":"        except Exception:"},{"line_number":246,"context_line":"            LOG.exception(\"websocket create connection failed\","},{"line_number":247,"context_line":"                          exc_info\u003dTrue)"},{"line_number":248,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_8e68c9f4","side":"PARENT","line":245,"range":{"start_line":245,"start_character":8,"end_line":245,"end_character":25},"updated":"2017-08-31 06:56:54.000000000","message":"Now that you are touching upon this code. Do you really want to leave a catch-all except or perhaps you can dig into possible exceptions and catch those instead?","commit_id":"5e2db97a46cb8fa64115c584b0907e88c05f0647"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f74afc9fa764dd080cb1509231b97905cb40e108","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        except websocket.WebSocketBadStatusException:"},{"line_number":243,"context_line":"            LOG.error(\"webSocket bad status exception\", exc_info\u003dTrue)"},{"line_number":244,"context_line":"            return None"},{"line_number":245,"context_line":"        except Exception:"},{"line_number":246,"context_line":"            LOG.exception(\"websocket create connection failed\","},{"line_number":247,"context_line":"                          exc_info\u003dTrue)"},{"line_number":248,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_11c99c57","side":"PARENT","line":245,"range":{"start_line":245,"start_character":8,"end_line":245,"end_character":25},"in_reply_to":"7f287b81_8e68c9f4","updated":"2017-08-31 07:15:05.000000000","message":"Yeah. Thing is, websocket.create_connection calls the entire world (tcp stack, etc.) and I think it would be a lot of work to dig up the full list of exceptions that can occur and all it would add is a slightly more friendly (but not more informative) log msg. No matter what goes wrong we need to return None which causes the main loop to wait and then try again so there is no functional difference between how the different exceptions are handled.","commit_id":"5e2db97a46cb8fa64115c584b0907e88c05f0647"}],"networking_odl/tests/unit/common/test_websocket_client.py":[{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"6226eb2a43066e812de637732df532fcf90c47f0","unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @mock.patch.object(websocket, \u0027create_connection\u0027)"},{"line_number":140,"context_line":"    def test_create_connection_handles_exception(self, mock_create_connection):"},{"line_number":141,"context_line":"        mock_create_connection.side_effect \u003d Exception(\"something went wrong\")"},{"line_number":142,"context_line":"        return_value \u003d self.mgr._socket_create_connection(\"localhost\")"},{"line_number":143,"context_line":"        self.assertIsNone(return_value)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_ce1a51c4","line":141,"range":{"start_line":141,"start_character":31,"end_line":141,"end_character":78},"updated":"2017-08-31 06:56:54.000000000","message":"put it in the decorator.","commit_id":"8a236a2c9bfd47357f07e5d1bb063a51ea09cc79"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f74afc9fa764dd080cb1509231b97905cb40e108","unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @mock.patch.object(websocket, \u0027create_connection\u0027)"},{"line_number":140,"context_line":"    def test_create_connection_handles_exception(self, mock_create_connection):"},{"line_number":141,"context_line":"        mock_create_connection.side_effect \u003d Exception(\"something went wrong\")"},{"line_number":142,"context_line":"        return_value \u003d self.mgr._socket_create_connection(\"localhost\")"},{"line_number":143,"context_line":"        self.assertIsNone(return_value)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_d1be74ac","line":141,"range":{"start_line":141,"start_character":31,"end_line":141,"end_character":78},"in_reply_to":"7f287b81_ce1a51c4","updated":"2017-08-31 07:15:05.000000000","message":"Done","commit_id":"8a236a2c9bfd47357f07e5d1bb063a51ea09cc79"}]}
