The error handling needs refinement.