| Summary: | Remove all old usage of _error() from GridShib-CA code and replace with Exceptions | ||
|---|---|---|---|
| Product: | GridShib | Reporter: | Von Welch <vwelch@uiuc.edu> |
| Component: | GridShib-CA | Assignee: | Terrence Fleury <tfleury@ncsa.uiuc.edu> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 2.0.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | |||
| Bug Blocks: | 6808 | ||
I looked at all instances of _error(), error(), and err() in the perl/Globus and perl/GridShibCA directories. The remaining instances are okay. The functions that call error() typically return "null" upon error rather than relying on exceptions. I think this is okay. Otherwise, we would need to add exceptions to perl/Globus/*.pm.
To fill in history here. GS-CA used to use a paradigm of object methods returning null to indicate an error and then the caller needed to call an error() (or something similar) method to obtain a string describing the error cause. The _error() method was an internal method for the object to use in order to set state regarding the error so that the subsequent call to error() had appropriate state to return. For 2.0 I moved to using Exceptions (as provided by Error::Simple - http://search.cpan.org/dist/Error/) because it made debugging easier (one can get stack traces from a thrown exception), and also allowed for returning more complicated data than a single string. Using exception also protects against mistakes by a method caller failing to check return status and other reasons one can find easily on the net.