← 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/652427
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=31f7fc6bb24995376bb74d7de6866f5bf2b322c8
Submitter: Zuul
Branch:    master

commit 31f7fc6bb24995376bb74d7de6866f5bf2b322c8
Author: Robin Cernin <cerninr@xxxxxxxxx>
Date:   Mon Apr 15 10:22:15 2019 +1000

    Deprecate exceptions.check_message
    
    exceptions.handle() is used in most cases consistently.
    check_message() is a legacy which was introduced when exceptions
    were not well classified. exceptions.handle() should cover all
    common error scenarios and there is no role played by check_messages().
    Let's clean up its usage and deprecate it for the future removal.
    
    Co-Authored-By: Akihiro Motoki <amotoki@xxxxxxxxx>
    Change-Id: I545b6c666d13d39cf5287ccc7c972dc746faf2fb
    Closes-Bug: #1339885


** Changed in: horizon
       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):
  Fix Released
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