UglifyJS mangles the error names causing error handling not to work properly

Bug #1745944 reported by Jiri Tomasek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Jiri Tomasek

Bug Description

Code mangling and minification provided by UglifyJS webpack plugin mangles the error names provided by Error.prototype.name. This causes error handling not to work in production mode as we are testing against error name to handle errors.

Possible solutions:
Update to latest UglifyJS webpack plugin and use keep_fnames mangle option to preserve error name. Better alternative is to stick with default UglifyJS behavior and explicitly set error name in error constructor. This ensures that the error name won't get mangled.

Tags: ui
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-ui (master)

Fix proposed to branch: master
Review: https://review.openstack.org/538844

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-ui (master)

Reviewed: https://review.openstack.org/538844
Committed: https://git.openstack.org/cgit/openstack/tripleo-ui/commit/?id=0d7bcdb74bc65a0c66e2813799a4c1126eddfeb6
Submitter: Zuul
Branch: master

commit 0d7bcdb74bc65a0c66e2813799a4c1126eddfeb6
Author: Jiri Tomasek <email address hidden>
Date: Mon Jan 29 10:01:17 2018 +0100

    Set error names explicitly

    Setting error names explicitly in constructor ensures that code mangling
    for production provided by UglifyJS does not break error handling logic.

    UglifyJS mangles Error.prototype.name by default.

    Closes-Bug: 1745944
    Change-Id: Id0ae3b9427a07a1910e7a6976da76a06abb104f1

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-ui 8.3.0

This issue was fixed in the openstack/tripleo-ui 8.3.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.