improve error handling

Properly handle ierr > 0 "warnings" returned by dpchfe upon evaluation.
Report ierr value as the error's code upon an internal error.
check for invalid numeric arrays
add unit tests