Return 'undefined' when throwing an exception

Several WKT parsing methods *may* throw an exception.
In these cases the expected return type is not satisfied.
This PR fixes this by adding `undefined` as a type.