Implements an error enum with mappings from the low-level C calls and appropriate error descriptions.