{"action":"created","comment":{"url":"https://api.github.com/repos/olemb/mido/pulls/comments/97998123","pull_request_review_id":18625212,"id":97998123,"diff_hunk":"@@ -70,6 +88,37 @@ def _dbg(text=''):\n     print(text)\n \n \n+def _handle_error(error_msg, error_mode):\n+    if error_mode == 'raise':\n+        raise MidiFileError(error_msg)\n+    elif error_mode == 'warn':\n+        warnings.warn(error_msg)\n+    elif error_mode == 'debug':\n+        _dbg(error_msg)\n+    elif error_mode == 'ignore':\n+        pass\n+    else:\n+        raise ValueError('unknown error mode {!r}'.format(error_mode))\n+\n+\n+def _clip_data_bytes(data_bytes, error_mode):","path":"mido/midifiles/midifiles.py","position":58,"original_position":58,"commit_id":"24ab7507cd581fbfbcf513cae39e752dc86174ce","original_commit_id":"24ab7507cd581fbfbcf513cae39e752dc86174ce","user":{"login":"carlthome","id":1595907,"avatar_url":"https://avatars.githubusercontent.com/u/1595907?v=3","gravatar_id":"","url":"https://api.github.com/users/carlthome","html_url":"https://github.com/carlthome","followers_url":"https://api.github.com/users/carlthome/followers","following_url":"https://api.github.com/users/carlthome/following{/other_user}","gists_url":"https://api.github.com/users/carlthome/gists{/gist_id}","starred_url":"https://api.github.com/users/carlthome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlthome/subscriptions","organizations_url":"https://api.github.com/users/carlthome/orgs","repos_url":"https://api.github.com/users/carlthome/repos","events_url":"https://api.github.com/users/carlthome/events{/privacy}","received_events_url":"https://api.github.com/users/carlthome/received_events","type":"User","site_admin":false},"body":"Nice! It's silly that this is the convention among MIDI software (Ardour, Logic, Timidity, etc.), but best be consistent.","created_at":"2017-01-26T14:00:43Z","updated_at":"2017-01-26T14:04:18Z","html_url":"https://github.com/olemb/mido/pull/68#discussion_r97998123","pull_request_url":"https://api.github.com/repos/olemb/mido/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/olemb/mido/pulls/comments/97998123"},"html":{"href":"https://github.com/olemb/mido/pull/68#discussion_r97998123"},"pull_request":{"href":"https://api.github.com/repos/olemb/mido/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/olemb/mido/pulls/68","id":91483363,"html_url":"https://github.com/olemb/mido/pull/68","diff_url":"https://github.com/olemb/mido/pull/68.diff","patch_url":"https://github.com/olemb/mido/pull/68.patch","issue_url":"https://api.github.com/repos/olemb/mido/issues/68","number":68,"state":"closed","locked":false,"title":"Added error mode option to MidiFile as discussed in issue #63.","user":{"login":"olemb","id":996566,"avatar_url":"https://avatars.githubusercontent.com/u/996566?v=3","gravatar_id":"","url":"https://api.github.com/users/olemb","html_url":"https://github.com/olemb","followers_url":"https://api.github.com/users/olemb/followers","following_url":"https://api.github.com/users/olemb/following{/other_user}","gists_url":"https://api.github.com/users/olemb/gists{/gist_id}","starred_url":"https://api.github.com/users/olemb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olemb/subscriptions","organizations_url":"https://api.github.com/users/olemb/orgs","repos_url":"https://api.github.com/users/olemb/repos","events_url":"https://api.github.com/users/olemb/events{/privacy}","received_events_url":"https://api.github.com/users/olemb/received_events","type":"User","site_admin":false},"body":"This passes an `error_mode` variable around in `read_track()`, `read_message()` etc.\n","created_at":"2016-10-29T08:44:54Z","updated_at":"2017-01-26T14:04:18Z","closed_at":"2017-01-26T10:38:40Z","merged_at":null,"merge_commit_sha":"84d66270328540e85a904d6646272f75c12e2e6b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/olemb/mido/pulls/68/commits","review_comments_url":"https://api.github.com/repos/olemb/mido/pulls/68/comments","review_comment_url":"https://api.github.com/repos/olemb/mido/pulls/comments{/number}","comments_url":"https://api.github.com/repos/olemb/mido/issues/68/comments","statuses_url":"https://api.github.com/repos/olemb/mido/statuses/24ab7507cd581fbfbcf513cae39e752dc86174ce","head":{"label":"olemb:midifile-pass-around-error-mode","ref":"midifile-pass-around-error-mode","sha":"24ab7507cd581fbfbcf513cae39e752dc86174ce","user":{"login":"olemb","id":996566,"avatar_url":"https://avatars.githubusercontent.com/u/996566?v=3","gravatar_id":"","url":"https://api.github.com/users/olemb","html_url":"https://github.com/olemb","followers_url":"https://api.github.com/users/olemb/followers","following_url":"https://api.github.com/users/olemb/following{/other_user}","gists_url":"https://api.github.com/users/olemb/gists{/gist_id}","starred_url":"https://api.github.com/users/olemb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olemb/subscriptions","organizations_url":"https://api.github.com/users/olemb/orgs","repos_url":"https://api.github.com/users/olemb/repos","events_url":"https://api.github.com/users/olemb/events{/privacy}","received_events_url":"https://api.github.com/users/olemb/received_events","type":"User","site_admin":false},"repo":{"id":10889417,"name":"mido","full_name":"olemb/mido","owner":{"login":"olemb","id":996566,"avatar_url":"https://avatars.githubusercontent.com/u/996566?v=3","gravatar_id":"","url":"https://api.github.com/users/olemb","html_url":"https://github.com/olemb","followers_url":"https://api.github.com/users/olemb/followers","following_url":"https://api.github.com/users/olemb/following{/other_user}","gists_url":"https://api.github.com/users/olemb/gists{/gist_id}","starred_url":"https://api.github.com/users/olemb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olemb/subscriptions","organizations_url":"https://api.github.com/users/olemb/orgs","repos_url":"https://api.github.com/users/olemb/repos","events_url":"https://api.github.com/users/olemb/events{/privacy}","received_events_url":"https://api.github.com/users/olemb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olemb/mido","description":"MIDI Objects for Python","fork":false,"url":"https://api.github.com/repos/olemb/mido","forks_url":"https://api.github.com/repos/olemb/mido/forks","keys_url":"https://api.github.com/repos/olemb/mido/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olemb/mido/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olemb/mido/teams","hooks_url":"https://api.github.com/repos/olemb/mido/hooks","issue_events_url":"https://api.github.com/repos/olemb/mido/issues/events{/number}","events_url":"https://api.github.com/repos/olemb/mido/events","assignees_url":"https://api.github.com/repos/olemb/mido/assignees{/user}","branches_url":"https://api.github.com/repos/olemb/mido/branches{/branch}","tags_url":"https://api.github.com/repos/olemb/mido/tags","blobs_url":"https://api.github.com/repos/olemb/mido/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olemb/mido/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olemb/mido/git/refs{/sha}","trees_url":"https://api.github.com/repos/olemb/mido/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olemb/mido/statuses/{sha}","languages_url":"https://api.github.com/repos/olemb/mido/languages","stargazers_url":"https://api.github.com/repos/olemb/mido/stargazers","contributors_url":"https://api.github.com/repos/olemb/mido/contributors","subscribers_url":"https://api.github.com/repos/olemb/mido/subscribers","subscription_url":"https://api.github.com/repos/olemb/mido/subscription","commits_url":"https://api.github.com/repos/olemb/mido/commits{/sha}","git_commits_url":"https://api.github.com/repos/olemb/mido/git/commits{/sha}","comments_url":"https://api.github.com/repos/olemb/mido/comments{/number}","issue_comment_url":"https://api.github.com/repos/olemb/mido/issues/comments{/number}","contents_url":"https://api.github.com/repos/olemb/mido/contents/{+path}","compare_url":"https://api.github.com/repos/olemb/mido/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olemb/mido/merges","archive_url":"https://api.github.com/repos/olemb/mido/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olemb/mido/downloads","issues_url":"https://api.github.com/repos/olemb/mido/issues{/number}","pulls_url":"https://api.github.com/repos/olemb/mido/pulls{/number}","milestones_url":"https://api.github.com/repos/olemb/mido/milestones{/number}","notifications_url":"https://api.github.com/repos/olemb/mido/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olemb/mido/labels{/name}","releases_url":"https://api.github.com/repos/olemb/mido/releases{/id}","deployments_url":"https://api.github.com/repos/olemb/mido/deployments","created_at":"2013-06-23T18:11:38Z","updated_at":"2017-01-21T20:11:08Z","pushed_at":"2017-01-26T13:45:24Z","git_url":"git://github.com/olemb/mido.git","ssh_url":"git@github.com:olemb/mido.git","clone_url":"https://github.com/olemb/mido.git","svn_url":"https://github.com/olemb/mido","homepage":"","size":2161,"stargazers_count":123,"watchers_count":123,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":17,"forks":34,"open_issues":17,"watchers":123,"default_branch":"master"}},"base":{"label":"olemb:develop","ref":"develop","sha":"0994d0ece1410b606ce65903bc1946cf37ce5702","user":{"login":"olemb","id":996566,"avatar_url":"https://avatars.githubusercontent.com/u/996566?v=3","gravatar_id":"","url":"https://api.github.com/users/olemb","html_url":"https://github.com/olemb","followers_url":"https://api.github.com/users/olemb/followers","following_url":"https://api.github.com/users/olemb/following{/other_user}","gists_url":"https://api.github.com/users/olemb/gists{/gist_id}","starred_url":"https://api.github.com/users/olemb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olemb/subscriptions","organizations_url":"https://api.github.com/users/olemb/orgs","repos_url":"https://api.github.com/users/olemb/repos","events_url":"https://api.github.com/users/olemb/events{/privacy}","received_events_url":"https://api.github.com/users/olemb/received_events","type":"User","site_admin":false},"repo":{"id":10889417,"name":"mido","full_name":"olemb/mido","owner":{"login":"olemb","id":996566,"avatar_url":"https://avatars.githubusercontent.com/u/996566?v=3","gravatar_id":"","url":"https://api.github.com/users/olemb","html_url":"https://github.com/olemb","followers_url":"https://api.github.com/users/olemb/followers","following_url":"https://api.github.com/users/olemb/following{/other_user}","gists_url":"https://api.github.com/users/olemb/gists{/gist_id}","starred_url":"https://api.github.com/users/olemb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olemb/subscriptions","organizations_url":"https://api.github.com/users/olemb/orgs","repos_url":"https://api.github.com/users/olemb/repos","events_url":"https://api.github.com/users/olemb/events{/privacy}","received_events_url":"https://api.github.com/users/olemb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olemb/mido","description":"MIDI Objects for Python","fork":false,"url":"https://api.github.com/repos/olemb/mido","forks_url":"https://api.github.com/repos/olemb/mido/forks","keys_url":"https://api.github.com/repos/olemb/mido/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olemb/mido/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olemb/mido/teams","hooks_url":"https://api.github.com/repos/olemb/mido/hooks","issue_events_url":"https://api.github.com/repos/olemb/mido/issues/events{/number}","events_url":"https://api.github.com/repos/olemb/mido/events","assignees_url":"https://api.github.com/repos/olemb/mido/assignees{/user}","branches_url":"https://api.github.com/repos/olemb/mido/branches{/branch}","tags_url":"https://api.github.com/repos/olemb/mido/tags","blobs_url":"https://api.github.com/repos/olemb/mido/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olemb/mido/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olemb/mido/git/refs{/sha}","trees_url":"https://api.github.com/repos/olemb/mido/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olemb/mido/statuses/{sha}","languages_url":"https://api.github.com/repos/olemb/mido/languages","stargazers_url":"https://api.github.com/repos/olemb/mido/stargazers","contributors_url":"https://api.github.com/repos/olemb/mido/contributors","subscribers_url":"https://api.github.com/repos/olemb/mido/subscribers","subscription_url":"https://api.github.com/repos/olemb/mido/subscription","commits_url":"https://api.github.com/repos/olemb/mido/commits{/sha}","git_commits_url":"https://api.github.com/repos/olemb/mido/git/commits{/sha}","comments_url":"https://api.github.com/repos/olemb/mido/comments{/number}","issue_comment_url":"https://api.github.com/repos/olemb/mido/issues/comments{/number}","contents_url":"https://api.github.com/repos/olemb/mido/contents/{+path}","compare_url":"https://api.github.com/repos/olemb/mido/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olemb/mido/merges","archive_url":"https://api.github.com/repos/olemb/mido/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olemb/mido/downloads","issues_url":"https://api.github.com/repos/olemb/mido/issues{/number}","pulls_url":"https://api.github.com/repos/olemb/mido/pulls{/number}","milestones_url":"https://api.github.com/repos/olemb/mido/milestones{/number}","notifications_url":"https://api.github.com/repos/olemb/mido/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olemb/mido/labels{/name}","releases_url":"https://api.github.com/repos/olemb/mido/releases{/id}","deployments_url":"https://api.github.com/repos/olemb/mido/deployments","created_at":"2013-06-23T18:11:38Z","updated_at":"2017-01-21T20:11:08Z","pushed_at":"2017-01-26T13:45:24Z","git_url":"git://github.com/olemb/mido.git","ssh_url":"git@github.com:olemb/mido.git","clone_url":"https://github.com/olemb/mido.git","svn_url":"https://github.com/olemb/mido","homepage":"","size":2161,"stargazers_count":123,"watchers_count":123,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":17,"forks":34,"open_issues":17,"watchers":123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/olemb/mido/pulls/68"},"html":{"href":"https://github.com/olemb/mido/pull/68"},"issue":{"href":"https://api.github.com/repos/olemb/mido/issues/68"},"comments":{"href":"https://api.github.com/repos/olemb/mido/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/olemb/mido/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/olemb/mido/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/olemb/mido/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/olemb/mido/statuses/24ab7507cd581fbfbcf513cae39e752dc86174ce"}}}}
{"actor":{"display_login":"carlthome"}}