Fixed: cast errors to strings before passing to logger.