Wrap geometry conversion with some error handling.