Adding error return numbers

Returns the error number when a certain error occurs.