Added different handling for errors and warnings.

Added different handling for errors and warnings.