add callback if errors/warnings occurred