Hide snippet white space
Improve error handling