catch exceptions thrown from toCSS