Improved error handling for drawing visualizations.