{"action":"created","comment":{"url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/comments/52649703","id":52649703,"diff_hunk":"@@ -94,19 +269,43 @@ OO.Ads.manager(function(_, $) {\n       'close' ];\n \n     /**\n-     * Helper function to verify that the xml has a valid vast ad in it and that it is a valid xml.\n-     * @param {xml} vastXML Contains the vast ad data to be parsed.\n+     * Helper function to verify that XML is valid\n+     * @param {xml} vastXML Contains the vast ad data to be parsed\n      * @returns {boolean} Returns true if the xml is valid otherwise it returns false.\n      */\n-    var isValidVastXML = _.bind(function(vastXML) {\n+    this.isValidVastXML = _.bind(function(vastXML) {\n+      return this.isValidRootTagName(vastXML) && this.isValidVastVersion(vastXML);\n+    }, this);\n+\n+    /**\n+     * Helper function to verify XML has valid VAST root tag.\n+     * @param {xml} vastXML Contains the vast ad data to be parsed\n+     * @returns {boolean} Returns true if the root tag is valid otherwise it returns false.\n+     */\n+    this.isValidRootTagName = _.bind(function(vastXML) {\n       var rootTagName = (vastXML && vastXML.firstChild) ? vastXML.firstChild.tagName || '' : '';\n       if (rootTagName.toUpperCase() != \"VAST\") {\n         OO.log(\"Invalid VAST XML for tag name: \" + rootTagName);\n+        this.trackError(this.ERROR_CODES.SCHEMA_VALIDATION, this.wrapperParentId);\n+        this.errorType = \"schemaValidationError\";","path":"js/ad_manager_vast.js","position":236,"original_position":236,"commit_id":"6881f10f6eec45617bbdad3d3a903fc6e789f9f3","original_commit_id":"6881f10f6eec45617bbdad3d3a903fc6e789f9f3","user":{"login":"angieisrani","id":6464189,"avatar_url":"https://avatars.githubusercontent.com/u/6464189?v=3","gravatar_id":"","url":"https://api.github.com/users/angieisrani","html_url":"https://github.com/angieisrani","followers_url":"https://api.github.com/users/angieisrani/followers","following_url":"https://api.github.com/users/angieisrani/following{/other_user}","gists_url":"https://api.github.com/users/angieisrani/gists{/gist_id}","starred_url":"https://api.github.com/users/angieisrani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angieisrani/subscriptions","organizations_url":"https://api.github.com/users/angieisrani/orgs","repos_url":"https://api.github.com/users/angieisrani/repos","events_url":"https://api.github.com/users/angieisrani/events{/privacy}","received_events_url":"https://api.github.com/users/angieisrani/received_events","type":"User","site_admin":false},"body":"instead of hardcoding this, can you associate the this.ERROR_CODES object with both the name and number?\r\nsomething like:\r\nthis.ERROR_CODES = { SCHEMA_VALIDATION: { id: 101, type: \"schemaValidationError\" }, ...}","created_at":"2016-02-11T19:04:52Z","updated_at":"2016-02-11T19:04:52Z","html_url":"https://github.com/ooyala/html5-ad-plugins/pull/50#discussion_r52649703","pull_request_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/comments/52649703"},"html":{"href":"https://github.com/ooyala/html5-ad-plugins/pull/50#discussion_r52649703"},"pull_request":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/50","id":58838428,"html_url":"https://github.com/ooyala/html5-ad-plugins/pull/50","diff_url":"https://github.com/ooyala/html5-ad-plugins/pull/50.diff","patch_url":"https://github.com/ooyala/html5-ad-plugins/pull/50.patch","issue_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/50","number":50,"state":"open","locked":false,"title":"[PBI-744] Support error reporting events in VAST 3.0","user":{"login":"dchauOoyala","id":15880169,"avatar_url":"https://avatars.githubusercontent.com/u/15880169?v=3","gravatar_id":"","url":"https://api.github.com/users/dchauOoyala","html_url":"https://github.com/dchauOoyala","followers_url":"https://api.github.com/users/dchauOoyala/followers","following_url":"https://api.github.com/users/dchauOoyala/following{/other_user}","gists_url":"https://api.github.com/users/dchauOoyala/gists{/gist_id}","starred_url":"https://api.github.com/users/dchauOoyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchauOoyala/subscriptions","organizations_url":"https://api.github.com/users/dchauOoyala/orgs","repos_url":"https://api.github.com/users/dchauOoyala/repos","events_url":"https://api.github.com/users/dchauOoyala/events{/privacy}","received_events_url":"https://api.github.com/users/dchauOoyala/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-10T01:53:53Z","updated_at":"2016-02-11T19:04:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0887a594540f0515da459943e6bffa4be955d993","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/50/commits","review_comments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/50/comments","review_comment_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/50/comments","statuses_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/statuses/6881f10f6eec45617bbdad3d3a903fc6e789f9f3","head":{"label":"ooyala:PBI-744","ref":"PBI-744","sha":"6881f10f6eec45617bbdad3d3a903fc6e789f9f3","user":{"login":"ooyala","id":365274,"avatar_url":"https://avatars.githubusercontent.com/u/365274?v=3","gravatar_id":"","url":"https://api.github.com/users/ooyala","html_url":"https://github.com/ooyala","followers_url":"https://api.github.com/users/ooyala/followers","following_url":"https://api.github.com/users/ooyala/following{/other_user}","gists_url":"https://api.github.com/users/ooyala/gists{/gist_id}","starred_url":"https://api.github.com/users/ooyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooyala/subscriptions","organizations_url":"https://api.github.com/users/ooyala/orgs","repos_url":"https://api.github.com/users/ooyala/repos","events_url":"https://api.github.com/users/ooyala/events{/privacy}","received_events_url":"https://api.github.com/users/ooyala/received_events","type":"Organization","site_admin":false},"repo":{"id":33886489,"name":"html5-ad-plugins","full_name":"ooyala/html5-ad-plugins","owner":{"login":"ooyala","id":365274,"avatar_url":"https://avatars.githubusercontent.com/u/365274?v=3","gravatar_id":"","url":"https://api.github.com/users/ooyala","html_url":"https://github.com/ooyala","followers_url":"https://api.github.com/users/ooyala/followers","following_url":"https://api.github.com/users/ooyala/following{/other_user}","gists_url":"https://api.github.com/users/ooyala/gists{/gist_id}","starred_url":"https://api.github.com/users/ooyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooyala/subscriptions","organizations_url":"https://api.github.com/users/ooyala/orgs","repos_url":"https://api.github.com/users/ooyala/repos","events_url":"https://api.github.com/users/ooyala/events{/privacy}","received_events_url":"https://api.github.com/users/ooyala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ooyala/html5-ad-plugins","description":"","fork":false,"url":"https://api.github.com/repos/ooyala/html5-ad-plugins","forks_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/forks","keys_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/teams","hooks_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/hooks","issue_events_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/events","assignees_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/tags","blobs_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/languages","stargazers_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/stargazers","contributors_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/contributors","subscribers_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/subscribers","subscription_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/subscription","commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/merges","archive_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/downloads","issues_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/labels{/name}","releases_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/deployments","created_at":"2015-04-13T18:37:19Z","updated_at":"2016-02-10T15:14:21Z","pushed_at":"2016-02-11T01:35:15Z","git_url":"git://github.com/ooyala/html5-ad-plugins.git","ssh_url":"git@github.com:ooyala/html5-ad-plugins.git","clone_url":"https://github.com/ooyala/html5-ad-plugins.git","svn_url":"https://github.com/ooyala/html5-ad-plugins","homepage":null,"size":302,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"ooyala:master","ref":"master","sha":"7dc866ac3dfa2b2e45efea50c82eb62b29deb671","user":{"login":"ooyala","id":365274,"avatar_url":"https://avatars.githubusercontent.com/u/365274?v=3","gravatar_id":"","url":"https://api.github.com/users/ooyala","html_url":"https://github.com/ooyala","followers_url":"https://api.github.com/users/ooyala/followers","following_url":"https://api.github.com/users/ooyala/following{/other_user}","gists_url":"https://api.github.com/users/ooyala/gists{/gist_id}","starred_url":"https://api.github.com/users/ooyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooyala/subscriptions","organizations_url":"https://api.github.com/users/ooyala/orgs","repos_url":"https://api.github.com/users/ooyala/repos","events_url":"https://api.github.com/users/ooyala/events{/privacy}","received_events_url":"https://api.github.com/users/ooyala/received_events","type":"Organization","site_admin":false},"repo":{"id":33886489,"name":"html5-ad-plugins","full_name":"ooyala/html5-ad-plugins","owner":{"login":"ooyala","id":365274,"avatar_url":"https://avatars.githubusercontent.com/u/365274?v=3","gravatar_id":"","url":"https://api.github.com/users/ooyala","html_url":"https://github.com/ooyala","followers_url":"https://api.github.com/users/ooyala/followers","following_url":"https://api.github.com/users/ooyala/following{/other_user}","gists_url":"https://api.github.com/users/ooyala/gists{/gist_id}","starred_url":"https://api.github.com/users/ooyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooyala/subscriptions","organizations_url":"https://api.github.com/users/ooyala/orgs","repos_url":"https://api.github.com/users/ooyala/repos","events_url":"https://api.github.com/users/ooyala/events{/privacy}","received_events_url":"https://api.github.com/users/ooyala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ooyala/html5-ad-plugins","description":"","fork":false,"url":"https://api.github.com/repos/ooyala/html5-ad-plugins","forks_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/forks","keys_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/teams","hooks_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/hooks","issue_events_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/events","assignees_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/tags","blobs_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/languages","stargazers_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/stargazers","contributors_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/contributors","subscribers_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/subscribers","subscription_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/subscription","commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/merges","archive_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/downloads","issues_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/labels{/name}","releases_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/deployments","created_at":"2015-04-13T18:37:19Z","updated_at":"2016-02-10T15:14:21Z","pushed_at":"2016-02-11T01:35:15Z","git_url":"git://github.com/ooyala/html5-ad-plugins.git","ssh_url":"git@github.com:ooyala/html5-ad-plugins.git","clone_url":"https://github.com/ooyala/html5-ad-plugins.git","svn_url":"https://github.com/ooyala/html5-ad-plugins","homepage":null,"size":302,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/50"},"html":{"href":"https://github.com/ooyala/html5-ad-plugins/pull/50"},"issue":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/50"},"comments":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/statuses/6881f10f6eec45617bbdad3d3a903fc6e789f9f3"}}}}