Added error handling example to demo program