{"action":"created","comment":{"url":"https://api.github.com/repos/Humanizr/Humanizer/pulls/comments/81506574","pull_request_review_id":2481415,"id":81506574,"diff_hunk":"@@ -88,22 +88,34 @@ private string GetResourceForTimeSpan(TimeUnit unit, int count)\n         /// <summary>\n         /// \n         /// </summary>\n-        /// <param name=\"resourceKey\"></param>\n+        /// <param name=\"resourceKey\">The resource key.</param>\n         /// <returns></returns>\n+        /// <exception cref=\"ArgumentException\">If the resource not exists on the specified culture.</exception>\n         protected virtual string Format(string resourceKey)\n         {\n-            return Resources.GetResource(GetResourceKey(resourceKey), _culture);\n+            var resourceString = Resources.GetResource(GetResourceKey(resourceKey), _culture);\n+\n+            if (string.IsNullOrEmpty(resourceString))\n+                throw new ArgumentException(string.Format(\"The resource object with key '{0}' was not found\", resourceKey), nameof(resourceKey));\n+\n+            return resourceString;\n         }\n \n         /// <summary>\n-        /// \n+        /// Formats the specified resource key.\n         /// </summary>\n-        /// <param name=\"resourceKey\"></param>\n-        /// <param name=\"number\"></param>\n+        /// <param name=\"resourceKey\">The resource key.</param>\n+        /// <param name=\"number\">The number.</param>\n         /// <returns></returns>\n+        /// <exception cref=\"ArgumentException\">If the resource not exists on the specified culture.</exception>\n         protected virtual string Format(string resourceKey, int number)\n         {\n-            return Resources.GetResource(GetResourceKey(resourceKey, number), _culture).FormatWith(number);\n+            var resourceString = Resources.GetResource(GetResourceKey(resourceKey, number), _culture);\n+\n+            if (string.IsNullOrEmpty(resourceString))\n+                throw new ArgumentException(string.Format(\"The resource object with key '{0}' was not found\", resourceKey), nameof(resourceKey));","path":"src/Humanizer/Localisation/Formatters/DefaultFormatter.cs","position":35,"original_position":35,"commit_id":"199901d43fbb152ef278bb2561dbd01172b1eb2f","original_commit_id":"199901d43fbb152ef278bb2561dbd01172b1eb2f","user":{"login":"aloisdg","id":3449303,"avatar_url":"https://avatars.githubusercontent.com/u/3449303?v=3","gravatar_id":"","url":"https://api.github.com/users/aloisdg","html_url":"https://github.com/aloisdg","followers_url":"https://api.github.com/users/aloisdg/followers","following_url":"https://api.github.com/users/aloisdg/following{/other_user}","gists_url":"https://api.github.com/users/aloisdg/gists{/gist_id}","starred_url":"https://api.github.com/users/aloisdg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aloisdg/subscriptions","organizations_url":"https://api.github.com/users/aloisdg/orgs","repos_url":"https://api.github.com/users/aloisdg/repos","events_url":"https://api.github.com/users/aloisdg/events{/privacy}","received_events_url":"https://api.github.com/users/aloisdg/received_events","type":"User","site_admin":false},"body":"You can use [string interpolation](https://msdn.microsoft.com/en-us/library/dn961160.aspx).\r\n\r\n    string.Format(\"The resource object with key '{0}' was not found\", resourceKey)\r\n\r\n->\r\n\r\n    $\"The resource object with key '{resourceKey}' was not found\"\r\n","created_at":"2016-10-03T08:11:08Z","updated_at":"2016-10-03T08:11:08Z","html_url":"https://github.com/Humanizr/Humanizer/pull/588#discussion_r81506574","pull_request_url":"https://api.github.com/repos/Humanizr/Humanizer/pulls/588","_links":{"self":{"href":"https://api.github.com/repos/Humanizr/Humanizer/pulls/comments/81506574"},"html":{"href":"https://github.com/Humanizr/Humanizer/pull/588#discussion_r81506574"},"pull_request":{"href":"https://api.github.com/repos/Humanizr/Humanizer/pulls/588"}}},"pull_request":{"url":"https://api.github.com/repos/Humanizr/Humanizer/pulls/588","id":87634515,"html_url":"https://github.com/Humanizr/Humanizer/pull/588","diff_url":"https://github.com/Humanizr/Humanizer/pull/588.diff","patch_url":"https://github.com/Humanizr/Humanizer/pull/588.patch","issue_url":"https://api.github.com/repos/Humanizr/Humanizer/issues/588","number":588,"state":"open","locked":false,"title":"Add resource value validation for DefaultFormatter","user":{"login":"Chrissx","id":13184661,"avatar_url":"https://avatars.githubusercontent.com/u/13184661?v=3","gravatar_id":"","url":"https://api.github.com/users/Chrissx","html_url":"https://github.com/Chrissx","followers_url":"https://api.github.com/users/Chrissx/followers","following_url":"https://api.github.com/users/Chrissx/following{/other_user}","gists_url":"https://api.github.com/users/Chrissx/gists{/gist_id}","starred_url":"https://api.github.com/users/Chrissx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chrissx/subscriptions","organizations_url":"https://api.github.com/users/Chrissx/orgs","repos_url":"https://api.github.com/users/Chrissx/repos","events_url":"https://api.github.com/users/Chrissx/events{/privacy}","received_events_url":"https://api.github.com/users/Chrissx/received_events","type":"User","site_admin":false},"body":"Added some resource value validation to make the missing resources errors more clear. \r\n\r\nConnected to #551 .","created_at":"2016-10-02T13:52:17Z","updated_at":"2016-10-03T08:11:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3af81eae5d8991e988dcedcecc5c049f3faabb99","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Humanizr/Humanizer/pulls/588/commits","review_comments_url":"https://api.github.com/repos/Humanizr/Humanizer/pulls/588/comments","review_comment_url":"https://api.github.com/repos/Humanizr/Humanizer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Humanizr/Humanizer/issues/588/comments","statuses_url":"https://api.github.com/repos/Humanizr/Humanizer/statuses/199901d43fbb152ef278bb2561dbd01172b1eb2f","head":{"label":"Chrissx:issue-551","ref":"issue-551","sha":"199901d43fbb152ef278bb2561dbd01172b1eb2f","user":{"login":"Chrissx","id":13184661,"avatar_url":"https://avatars.githubusercontent.com/u/13184661?v=3","gravatar_id":"","url":"https://api.github.com/users/Chrissx","html_url":"https://github.com/Chrissx","followers_url":"https://api.github.com/users/Chrissx/followers","following_url":"https://api.github.com/users/Chrissx/following{/other_user}","gists_url":"https://api.github.com/users/Chrissx/gists{/gist_id}","starred_url":"https://api.github.com/users/Chrissx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chrissx/subscriptions","organizations_url":"https://api.github.com/users/Chrissx/orgs","repos_url":"https://api.github.com/users/Chrissx/repos","events_url":"https://api.github.com/users/Chrissx/events{/privacy}","received_events_url":"https://api.github.com/users/Chrissx/received_events","type":"User","site_admin":false},"repo":{"id":69798330,"name":"Humanizer","full_name":"Chrissx/Humanizer","owner":{"login":"Chrissx","id":13184661,"avatar_url":"https://avatars.githubusercontent.com/u/13184661?v=3","gravatar_id":"","url":"https://api.github.com/users/Chrissx","html_url":"https://github.com/Chrissx","followers_url":"https://api.github.com/users/Chrissx/followers","following_url":"https://api.github.com/users/Chrissx/following{/other_user}","gists_url":"https://api.github.com/users/Chrissx/gists{/gist_id}","starred_url":"https://api.github.com/users/Chrissx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chrissx/subscriptions","organizations_url":"https://api.github.com/users/Chrissx/orgs","repos_url":"https://api.github.com/users/Chrissx/repos","events_url":"https://api.github.com/users/Chrissx/events{/privacy}","received_events_url":"https://api.github.com/users/Chrissx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Chrissx/Humanizer","description":"Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities","fork":true,"url":"https://api.github.com/repos/Chrissx/Humanizer","forks_url":"https://api.github.com/repos/Chrissx/Humanizer/forks","keys_url":"https://api.github.com/repos/Chrissx/Humanizer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Chrissx/Humanizer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Chrissx/Humanizer/teams","hooks_url":"https://api.github.com/repos/Chrissx/Humanizer/hooks","issue_events_url":"https://api.github.com/repos/Chrissx/Humanizer/issues/events{/number}","events_url":"https://api.github.com/repos/Chrissx/Humanizer/events","assignees_url":"https://api.github.com/repos/Chrissx/Humanizer/assignees{/user}","branches_url":"https://api.github.com/repos/Chrissx/Humanizer/branches{/branch}","tags_url":"https://api.github.com/repos/Chrissx/Humanizer/tags","blobs_url":"https://api.github.com/repos/Chrissx/Humanizer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Chrissx/Humanizer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Chrissx/Humanizer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Chrissx/Humanizer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Chrissx/Humanizer/statuses/{sha}","languages_url":"https://api.github.com/repos/Chrissx/Humanizer/languages","stargazers_url":"https://api.github.com/repos/Chrissx/Humanizer/stargazers","contributors_url":"https://api.github.com/repos/Chrissx/Humanizer/contributors","subscribers_url":"https://api.github.com/repos/Chrissx/Humanizer/subscribers","subscription_url":"https://api.github.com/repos/Chrissx/Humanizer/subscription","commits_url":"https://api.github.com/repos/Chrissx/Humanizer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Chrissx/Humanizer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Chrissx/Humanizer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Chrissx/Humanizer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Chrissx/Humanizer/contents/{+path}","compare_url":"https://api.github.com/repos/Chrissx/Humanizer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Chrissx/Humanizer/merges","archive_url":"https://api.github.com/repos/Chrissx/Humanizer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Chrissx/Humanizer/downloads","issues_url":"https://api.github.com/repos/Chrissx/Humanizer/issues{/number}","pulls_url":"https://api.github.com/repos/Chrissx/Humanizer/pulls{/number}","milestones_url":"https://api.github.com/repos/Chrissx/Humanizer/milestones{/number}","notifications_url":"https://api.github.com/repos/Chrissx/Humanizer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Chrissx/Humanizer/labels{/name}","releases_url":"https://api.github.com/repos/Chrissx/Humanizer/releases{/id}","deployments_url":"https://api.github.com/repos/Chrissx/Humanizer/deployments","created_at":"2016-10-02T13:22:29Z","updated_at":"2016-10-02T13:22:32Z","pushed_at":"2016-10-02T14:09:39Z","git_url":"git://github.com/Chrissx/Humanizer.git","ssh_url":"git@github.com:Chrissx/Humanizer.git","clone_url":"https://github.com/Chrissx/Humanizer.git","svn_url":"https://github.com/Chrissx/Humanizer","homepage":"","size":5796,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"Humanizr:dev","ref":"dev","sha":"f49dc9264fe188858f0a124645fcc369c15dadf3","user":{"login":"Humanizr","id":15205373,"avatar_url":"https://avatars.githubusercontent.com/u/15205373?v=3","gravatar_id":"","url":"https://api.github.com/users/Humanizr","html_url":"https://github.com/Humanizr","followers_url":"https://api.github.com/users/Humanizr/followers","following_url":"https://api.github.com/users/Humanizr/following{/other_user}","gists_url":"https://api.github.com/users/Humanizr/gists{/gist_id}","starred_url":"https://api.github.com/users/Humanizr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Humanizr/subscriptions","organizations_url":"https://api.github.com/users/Humanizr/orgs","repos_url":"https://api.github.com/users/Humanizr/repos","events_url":"https://api.github.com/users/Humanizr/events{/privacy}","received_events_url":"https://api.github.com/users/Humanizr/received_events","type":"Organization","site_admin":false},"repo":{"id":4213474,"name":"Humanizer","full_name":"Humanizr/Humanizer","owner":{"login":"Humanizr","id":15205373,"avatar_url":"https://avatars.githubusercontent.com/u/15205373?v=3","gravatar_id":"","url":"https://api.github.com/users/Humanizr","html_url":"https://github.com/Humanizr","followers_url":"https://api.github.com/users/Humanizr/followers","following_url":"https://api.github.com/users/Humanizr/following{/other_user}","gists_url":"https://api.github.com/users/Humanizr/gists{/gist_id}","starred_url":"https://api.github.com/users/Humanizr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Humanizr/subscriptions","organizations_url":"https://api.github.com/users/Humanizr/orgs","repos_url":"https://api.github.com/users/Humanizr/repos","events_url":"https://api.github.com/users/Humanizr/events{/privacy}","received_events_url":"https://api.github.com/users/Humanizr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Humanizr/Humanizer","description":"Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities","fork":false,"url":"https://api.github.com/repos/Humanizr/Humanizer","forks_url":"https://api.github.com/repos/Humanizr/Humanizer/forks","keys_url":"https://api.github.com/repos/Humanizr/Humanizer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Humanizr/Humanizer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Humanizr/Humanizer/teams","hooks_url":"https://api.github.com/repos/Humanizr/Humanizer/hooks","issue_events_url":"https://api.github.com/repos/Humanizr/Humanizer/issues/events{/number}","events_url":"https://api.github.com/repos/Humanizr/Humanizer/events","assignees_url":"https://api.github.com/repos/Humanizr/Humanizer/assignees{/user}","branches_url":"https://api.github.com/repos/Humanizr/Humanizer/branches{/branch}","tags_url":"https://api.github.com/repos/Humanizr/Humanizer/tags","blobs_url":"https://api.github.com/repos/Humanizr/Humanizer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Humanizr/Humanizer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Humanizr/Humanizer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Humanizr/Humanizer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Humanizr/Humanizer/statuses/{sha}","languages_url":"https://api.github.com/repos/Humanizr/Humanizer/languages","stargazers_url":"https://api.github.com/repos/Humanizr/Humanizer/stargazers","contributors_url":"https://api.github.com/repos/Humanizr/Humanizer/contributors","subscribers_url":"https://api.github.com/repos/Humanizr/Humanizer/subscribers","subscription_url":"https://api.github.com/repos/Humanizr/Humanizer/subscription","commits_url":"https://api.github.com/repos/Humanizr/Humanizer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Humanizr/Humanizer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Humanizr/Humanizer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Humanizr/Humanizer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Humanizr/Humanizer/contents/{+path}","compare_url":"https://api.github.com/repos/Humanizr/Humanizer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Humanizr/Humanizer/merges","archive_url":"https://api.github.com/repos/Humanizr/Humanizer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Humanizr/Humanizer/downloads","issues_url":"https://api.github.com/repos/Humanizr/Humanizer/issues{/number}","pulls_url":"https://api.github.com/repos/Humanizr/Humanizer/pulls{/number}","milestones_url":"https://api.github.com/repos/Humanizr/Humanizer/milestones{/number}","notifications_url":"https://api.github.com/repos/Humanizr/Humanizer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Humanizr/Humanizer/labels{/name}","releases_url":"https://api.github.com/repos/Humanizr/Humanizer/releases{/id}","deployments_url":"https://api.github.com/repos/Humanizr/Humanizer/deployments","created_at":"2012-05-03T12:01:45Z","updated_at":"2016-10-01T16:34:33Z","pushed_at":"2016-10-02T14:09:39Z","git_url":"git://github.com/Humanizr/Humanizer.git","ssh_url":"git@github.com:Humanizr/Humanizer.git","clone_url":"https://github.com/Humanizr/Humanizer.git","svn_url":"https://github.com/Humanizr/Humanizer","homepage":"","size":9281,"stargazers_count":2242,"watchers_count":2242,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":393,"mirror_url":null,"open_issues_count":66,"forks":393,"open_issues":66,"watchers":2242,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Humanizr/Humanizer/pulls/588"},"html":{"href":"https://github.com/Humanizr/Humanizer/pull/588"},"issue":{"href":"https://api.github.com/repos/Humanizr/Humanizer/issues/588"},"comments":{"href":"https://api.github.com/repos/Humanizr/Humanizer/issues/588/comments"},"review_comments":{"href":"https://api.github.com/repos/Humanizr/Humanizer/pulls/588/comments"},"review_comment":{"href":"https://api.github.com/repos/Humanizr/Humanizer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Humanizr/Humanizer/pulls/588/commits"},"statuses":{"href":"https://api.github.com/repos/Humanizr/Humanizer/statuses/199901d43fbb152ef278bb2561dbd01172b1eb2f"}}}}
{"actor":{"display_login":"aloisdg"}}