GitHub PullRequestReviewCommentEvent at 2014-09-03 01:57:36
Repository: nit
Actor: privat
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/privat/nit/pulls/comments/17028060","id":17028060,"diff_hunk":"@@ -0,0 +1,60 @@\n+# This file is part of NIT ( http://www.nitlanguage.org ).\n+#\n+# This file is free software, which comes along with NIT.  This software is\n+# distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n+# without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A\n+# PARTICULAR PURPOSE.  You can modify it is you want,  provided this header\n+# is kept unaltered, and a notification of the changes is added.\n+# You  are  allowed  to  redistribute it and sell it, alone or is a part of\n+# another product.\n+\n+# Standard error-management infrastructure.\n+module error\n+\n+import string\n+\n+# Standard class for error messages\n+interface Error\n+\t# A short human-readable error message.\n+\t#\n+\t# This message is short and informative and could be displayed on the console, a dialog-box\n+\t# or written in a log file.\n+\t#\n+\t# It is better that the message is high-level defined and autonomous.\n+\t# Thus does depend the less possible on contextual information.\n+\t#\n+\t# Eg. instead of \"Fatal error: cannot open file\",\n+\t# something like \"File error, cannot open /some/path/document.ext, file not found.\" is preferred,\n+\t# where the message is informative as it, and the severity of the error is not assumed:\n+\t# while fatal for the library, it could be something benign for the program.\n+\tfun message: String is abstract\n+\n+\t# An original error that caused the creation of this error, if any.\n+\t#\n+\t# This is used to chain errors and track the implication of various sub-systems for a given error.\n+\t#\n+\t# When displaying an error the end user, causes can be recursively displayed.\n+\tfun cause: nullable Error do return null\n+end\n+\n+# Helper class used as a return value of methods that may give errors instead of values.\n+#\n+# Functions that return useful values or errors could use it to simulate an easy-to use multiple-return.\n+class MaybeError[V, E: Error]\n+\t# The value, if any\n+\tvar maybe_value: nullable V\n+\n+\t# The error, if any\n+\tvar maybe_error: nullable E\n+","path":"lib/standard/error.nit","position":49,"original_position":49,"commit_id":"6df59d54df1eb882607fd5b1753b975221942a6e","original_commit_id":"6df59d54df1eb882607fd5b1753b975221942a6e","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=2","gravatar_id":"df707b6dfe51fbc364583485afd0a943","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"body":"en fait, `new MaybeError[Int, Error](5, null)` est plus court a écrire que `new MaybeError[Int, Error].with_value(5)`. Donc je sais pas trop :/","created_at":"2014-09-03T01:57:36Z","updated_at":"2014-09-03T01:57:36Z","html_url":"https://github.com/privat/nit/pull/707#discussion_r17028060","pull_request_url":"https://api.github.com/repos/privat/nit/pulls/707","_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/comments/17028060"},"html":{"href":"https://github.com/privat/nit/pull/707#discussion_r17028060"},"pull_request":{"href":"https://api.github.com/repos/privat/nit/pulls/707"}}},"pull_request":{"url":"https://api.github.com/repos/privat/nit/pulls/707","id":20629446,"html_url":"https://github.com/privat/nit/pull/707","diff_url":"https://github.com/privat/nit/pull/707.diff","patch_url":"https://github.com/privat/nit/pull/707.patch","issue_url":"https://api.github.com/repos/privat/nit/issues/707","number":707,"state":"open","locked":false,"title":"lib: add standard/error.nit","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=2","gravatar_id":"df707b6dfe51fbc364583485afd0a943","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"body":"This could help people to implement some error handling in libraries.\r\n\r\nIt is inspired by #701 and ideas from Alexandre Terrasa.\r\n","created_at":"2014-09-02T18:00:51Z","updated_at":"2014-09-03T01:57:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8c9d92a7b504d810d34f2f3e4f7f29febb41222","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/privat/nit/pulls/707/commits","review_comments_url":"https://api.github.com/repos/privat/nit/pulls/707/comments","review_comment_url":"https://api.github.com/repos/privat/nit/pulls/comments/{number}","comments_url":"https://api.github.com/repos/privat/nit/issues/707/comments","statuses_url":"https://api.github.com/repos/privat/nit/statuses/6df59d54df1eb882607fd5b1753b975221942a6e","head":{"label":"privat:errors","ref":"errors","sha":"6df59d54df1eb882607fd5b1753b975221942a6e","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=2","gravatar_id":"df707b6dfe51fbc364583485afd0a943","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"repo":{"id":328597,"name":"nit","full_name":"privat/nit","owner":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=2","gravatar_id":"df707b6dfe51fbc364583485afd0a943","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/privat/nit","description":"Nit language","fork":false,"url":"https://api.github.com/repos/privat/nit","forks_url":"https://api.github.com/repos/privat/nit/forks","keys_url":"https://api.github.com/repos/privat/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privat/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privat/nit/teams","hooks_url":"https://api.github.com/repos/privat/nit/hooks","issue_events_url":"https://api.github.com/repos/privat/nit/issues/events{/number}","events_url":"https://api.github.com/repos/privat/nit/events","assignees_url":"https://api.github.com/repos/privat/nit/assignees{/user}","branches_url":"https://api.github.com/repos/privat/nit/branches{/branch}","tags_url":"https://api.github.com/repos/privat/nit/tags","blobs_url":"https://api.github.com/repos/privat/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privat/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privat/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/privat/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privat/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/privat/nit/languages","stargazers_url":"https://api.github.com/repos/privat/nit/stargazers","contributors_url":"https://api.github.com/repos/privat/nit/contributors","subscribers_url":"https://api.github.com/repos/privat/nit/subscribers","subscription_url":"https://api.github.com/repos/privat/nit/subscription","commits_url":"https://api.github.com/repos/privat/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/privat/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/privat/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/privat/nit/issues/comments/{number}","contents_url":"https://api.github.com/repos/privat/nit/contents/{+path}","compare_url":"https://api.github.com/repos/privat/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privat/nit/merges","archive_url":"https://api.github.com/repos/privat/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privat/nit/downloads","issues_url":"https://api.github.com/repos/privat/nit/issues{/number}","pulls_url":"https://api.github.com/repos/privat/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/privat/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/privat/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privat/nit/labels{/name}","releases_url":"https://api.github.com/repos/privat/nit/releases{/id}","created_at":"2009-10-06T15:03:00Z","updated_at":"2014-09-02T13:06:54Z","pushed_at":"2014-09-03T01:25:13Z","git_url":"git://github.com/privat/nit.git","ssh_url":"git@github.com:privat/nit.git","clone_url":"https://github.com/privat/nit.git","svn_url":"https://github.com/privat/nit","homepage":"http://nitlanguage.org","size":73940,"stargazers_count":22,"watchers_count":22,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":29,"mirror_url":null,"open_issues_count":56,"forks":29,"open_issues":56,"watchers":22,"default_branch":"master"}},"base":{"label":"privat:master","ref":"master","sha":"1b1a12f83c29fd7e250e92e255242b69af703a58","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=2","gravatar_id":"df707b6dfe51fbc364583485afd0a943","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"repo":{"id":328597,"name":"nit","full_name":"privat/nit","owner":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=2","gravatar_id":"df707b6dfe51fbc364583485afd0a943","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/privat/nit","description":"Nit language","fork":false,"url":"https://api.github.com/repos/privat/nit","forks_url":"https://api.github.com/repos/privat/nit/forks","keys_url":"https://api.github.com/repos/privat/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privat/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privat/nit/teams","hooks_url":"https://api.github.com/repos/privat/nit/hooks","issue_events_url":"https://api.github.com/repos/privat/nit/issues/events{/number}","events_url":"https://api.github.com/repos/privat/nit/events","assignees_url":"https://api.github.com/repos/privat/nit/assignees{/user}","branches_url":"https://api.github.com/repos/privat/nit/branches{/branch}","tags_url":"https://api.github.com/repos/privat/nit/tags","blobs_url":"https://api.github.com/repos/privat/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privat/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privat/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/privat/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privat/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/privat/nit/languages","stargazers_url":"https://api.github.com/repos/privat/nit/stargazers","contributors_url":"https://api.github.com/repos/privat/nit/contributors","subscribers_url":"https://api.github.com/repos/privat/nit/subscribers","subscription_url":"https://api.github.com/repos/privat/nit/subscription","commits_url":"https://api.github.com/repos/privat/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/privat/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/privat/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/privat/nit/issues/comments/{number}","contents_url":"https://api.github.com/repos/privat/nit/contents/{+path}","compare_url":"https://api.github.com/repos/privat/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privat/nit/merges","archive_url":"https://api.github.com/repos/privat/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privat/nit/downloads","issues_url":"https://api.github.com/repos/privat/nit/issues{/number}","pulls_url":"https://api.github.com/repos/privat/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/privat/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/privat/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privat/nit/labels{/name}","releases_url":"https://api.github.com/repos/privat/nit/releases{/id}","created_at":"2009-10-06T15:03:00Z","updated_at":"2014-09-02T13:06:54Z","pushed_at":"2014-09-03T01:25:13Z","git_url":"git://github.com/privat/nit.git","ssh_url":"git@github.com:privat/nit.git","clone_url":"https://github.com/privat/nit.git","svn_url":"https://github.com/privat/nit","homepage":"http://nitlanguage.org","size":73940,"stargazers_count":22,"watchers_count":22,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":29,"mirror_url":null,"open_issues_count":56,"forks":29,"open_issues":56,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/707"},"html":{"href":"https://github.com/privat/nit/pull/707"},"issue":{"href":"https://api.github.com/repos/privat/nit/issues/707"},"comments":{"href":"https://api.github.com/repos/privat/nit/issues/707/comments"},"review_comments":{"href":"https://api.github.com/repos/privat/nit/pulls/707/comments"},"review_comment":{"href":"https://api.github.com/repos/privat/nit/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/privat/nit/pulls/707/commits"},"statuses":{"href":"https://api.github.com/repos/privat/nit/statuses/6df59d54df1eb882607fd5b1753b975221942a6e"}}}}