Catch errors thrown by root.toCSS()