Fix error handling, extend testcases, add errors to documentation

* Searched for error-codes and had to look into source code
* maybe this is useful ;)