Error handler for scripts task