)]}'
{"neutron/api/v2/resource.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9d049345c68895b076fce5ca0942c0dc7a50d5f1","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            result \u003d method(request\u003drequest, **args)"},{"line_number":85,"context_line":"        except (exceptions.NeutronException,"},{"line_number":86,"context_line":"                netaddr.AddrFormatError) as e:"},{"line_number":87,"context_line":"            if isinstance(e, exceptions.NotFound):"},{"line_number":88,"context_line":"                LOG.info(_(\u0027%(action)s failed because: %(err)s\u0027),"},{"line_number":89,"context_line":"                         {\u0027action\u0027: action, \u0027err\u0027: e})"},{"line_number":90,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAS3%2F%2FJK8%3D","line":87,"updated":"2013-10-03 15:36:32.000000000","message":"I would personally fix this differently: I\u0027d be logging at info level for faults known as defined by the FAULT_MAP at line 99+1 and log at exception level before line 101, for everything else.","commit_id":"3a87e19317640a1ddeb9ba4f9ddc65c722dcf6b5"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"5df064427c9457c0307be5734a444e7c411fbef4","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            result \u003d method(request\u003drequest, **args)"},{"line_number":85,"context_line":"        except (exceptions.NeutronException,"},{"line_number":86,"context_line":"                netaddr.AddrFormatError) as e:"},{"line_number":87,"context_line":"            if isinstance(e, exceptions.NotFound):"},{"line_number":88,"context_line":"                LOG.info(_(\u0027%(action)s failed because: %(err)s\u0027),"},{"line_number":89,"context_line":"                         {\u0027action\u0027: action, \u0027err\u0027: e})"},{"line_number":90,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAS3%2F%2FI5o%3D","line":87,"in_reply_to":"AAAAS3%2F%2FJJo%3D","updated":"2013-10-03 16:33:42.000000000","message":"I really agree that we should log right before specific exception, not put it far away from the raise point.\n\ni) i only log NotFound instead of FAULT_MAP is because some important exceptions such as ServiceUnavialable(503) are in FAULT_MAP, and i think this need to let operator to know as an important error, not just an info (i think warning may not be enough for exception like MacGenerationFailure either). Although it intend to fix the specific bug, other exception such as Conflict/BadRequest/Forbidden can be added after discussion\n\nii) i log here is because exception has been translated with the request language (may not be same as host locale), since the object e has been changed inside translate, while should be translated before raise, i don\u0027t know how to get the untranslated exception message when i log, so i have to put it right before translate is called. if you know some clean way, please teach me, it would be really useful.\n\nthank you for your comment","commit_id":"3a87e19317640a1ddeb9ba4f9ddc65c722dcf6b5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1ff07056c8034cbb5e24862904f032d2da6216ac","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            result \u003d method(request\u003drequest, **args)"},{"line_number":85,"context_line":"        except (exceptions.NeutronException,"},{"line_number":86,"context_line":"                netaddr.AddrFormatError) as e:"},{"line_number":87,"context_line":"            if isinstance(e, exceptions.NotFound):"},{"line_number":88,"context_line":"                LOG.info(_(\u0027%(action)s failed because: %(err)s\u0027),"},{"line_number":89,"context_line":"                         {\u0027action\u0027: action, \u0027err\u0027: e})"},{"line_number":90,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAS3%2F%2FJJo%3D","line":87,"in_reply_to":"AAAAS3%2F%2FJK8%3D","updated":"2013-10-03 15:39:03.000000000","message":"or maybe warning.","commit_id":"3a87e19317640a1ddeb9ba4f9ddc65c722dcf6b5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"148f0040578db3e5599d8f585bc23a0ac0e25438","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                LOG.info(_(\u0027%(action)s failed because: %(err)s\u0027),"},{"line_number":89,"context_line":"                         {\u0027action\u0027: action, \u0027err\u0027: e})"},{"line_number":90,"context_line":"            else:"},{"line_number":91,"context_line":"                LOG.exception(_(\u0027%s failed\u0027), action)"},{"line_number":92,"context_line":"            e \u003d translate(e, language)"},{"line_number":93,"context_line":"            # following structure is expected by python-neutronclient"},{"line_number":94,"context_line":"            err_data \u003d {\u0027type\u0027: e.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAT3%2F%2FqqI%3D","line":91,"updated":"2014-01-03 20:37:00.000000000","message":"This is the first that I\u0027ve looked at this exception handling code here.  The use of isinstance inside of except makes me think that this could be done better.\n\nI don\u0027t have a fully baked suggestion but is there any way to determine this in an object oriented way?  Maybe a method on NeutronException that could be overridden by NotFound or something to indicate that it is not an error level exception?\n\nYou could maybe handle NotFound with a separate except clause (before this one).  I guess that might mean some code duplication.","commit_id":"3a87e19317640a1ddeb9ba4f9ddc65c722dcf6b5"}]}
