Error handling to dataset_to_resource() and unit tests for resource conversions