Handle script errors