utils: packages: define the Error class

(integrated from trunk branch change fedebf3 by Todd Whiteman <toddw@activestate.com>)