Add error handling to Shader model