RackTables: master 6f949688

Author Committer Branch Timestamp Parent
infrastation infrastation master 2017-05-08 12:52:13 master 74b81bfc
Changeset refine more exception classes in port management

InvalidArgException means that a parameter has an invalid value in
general, whereas InvalidRequestArgException specifically means that
in addition to that the parameter value is the user input from a more
or less interactive session.

In the latter case the error message should be displayed back to the user
or, if the code does not expect the IRAE class for whatever reason, the
exception should land in the [supposedly present] more general IAE catch

With that in mind fix a long-standing anomaly by making commitAddPort()
and commitUpdatePort() throw an IAE object instead of IRAE. Make changes
to addPortForObject(), editPortForObject(), autoPopulateUCS() and
renameObjectPorts() such that those functions expect an IAE and can
reasonably handle it. Amend test declarations as necessary.

While at it, move code around in syncObjectPorts() to make sure all
exceptions cause the tables lock released soonest possible.
mod - wwwroot/inc/database.php Diff File
mod - wwwroot/inc/functions.php Diff File
mod - wwwroot/inc/ophandlers.php Diff File
mod - tests/PortTriggerTest.php Diff File