← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1339885] Re: exceptions.check_message does not work

 

Reviewed:  https://review.opendev.org/655119
Committed: https://git.openstack.org/cgit/openstack/manila-ui/commit/?id=e81a424f8715fa00e49cae902da4cd1824deaef4
Submitter: Zuul
Branch:    master

commit e81a424f8715fa00e49cae902da4cd1824deaef4
Author: Robin Cernin <rcernin@xxxxxxxxxx>
Date:   Tue Apr 23 22:12:11 2019 +1000

    Error handling: Use exceptions.handle instead of check_message
    
    We already have a centralized place for handling exceptions in horizon.
    We should use horizon/exceptions.py(249)handle() instead of old
    horizon/exceptions.py(96)check_message().
    
    Change-Id: I4add35f6ca407d8c3fa8ab5bd1b96221b1f5b043
    Closes-Bug: #1339885


** Changed in: manila-ui
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1339885

Title:
  exceptions.check_message does not work

Status in OpenStack Dashboard (Horizon):
  In Progress
Status in manila-ui:
  Fix Released

Bug description:
  When using exceptions.check_message to check if a connection was
  refused by an API, check_message will check to see if the exception's
  message contains "Connection" and "refused". When a connection is
  refused, the message does not contain exactly "Connection" and
  "refused", but rather "Connection" and "refused)". In this situation
  check_message does nothing and the exception is re-raised.

  To reproduce:

  Stop the Nova API
  Navigate to http://<ip>/admin/info/

  Other notes:
  1. Even if the error message contains "Connection" and "refused" exactly, the same error screen is shown, because the exception is re-raised in both situations, and is not being handled properly higher up.

  2. The exception being raised when a connection is refused is
  ConnectionError, a Python built-in exception.

  3. The only other situation where check_message is used within Horizon
  is in
  https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/volumes/tables.py
  when a volume is deleted. When this occurs, the re-raised exception is
  properly handled, and a red error message is shown correctly.

  4. The current use of check_message is not compatible with
  localization. The keywords checked for are not translated, so if the
  exception message is translated, the words will never match.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1339885/+subscriptions


References