added more descriptive error reporting for file conversion function