proper error handling for rasters