Ensure all errors have an 'errno' attribute.

In the absence of something specific, use 999 for "unspecified error".