Add error handling snippet