{"action":"closed","issue":{"url":"https://api.github.com/repos/guardian/scribe-plugin-noting/issues/52","labels_url":"https://api.github.com/repos/guardian/scribe-plugin-noting/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/guardian/scribe-plugin-noting/issues/52/comments","events_url":"https://api.github.com/repos/guardian/scribe-plugin-noting/issues/52/events","html_url":"https://github.com/guardian/scribe-plugin-noting/issues/52","id":52109259,"number":52,"title":"Explicit type checking hides information","user":{"login":"robinedman","id":1936213,"avatar_url":"https://avatars.githubusercontent.com/u/1936213?v=3","gravatar_id":"","url":"https://api.github.com/users/robinedman","html_url":"https://github.com/robinedman","followers_url":"https://api.github.com/users/robinedman/followers","following_url":"https://api.github.com/users/robinedman/following{/other_user}","gists_url":"https://api.github.com/users/robinedman/gists{/gist_id}","starred_url":"https://api.github.com/users/robinedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robinedman/subscriptions","organizations_url":"https://api.github.com/users/robinedman/orgs","repos_url":"https://api.github.com/users/robinedman/repos","events_url":"https://api.github.com/users/robinedman/events{/privacy}","received_events_url":"https://api.github.com/users/robinedman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-12-16T12:54:42Z","updated_at":"2015-03-11T15:03:44Z","closed_at":"2015-03-11T15:03:44Z","body":"At the moment we have type checking like:\r\n```\r\nif (!isVFocus(focus)) {\r\n    throw new Error('Only a valid VFocus element can be passed to findEntirenote');\r\n}\r\n```\r\n(https://github.com/guardian/scribe-plugin-noting/blob/jp-refactor-note-toggle/src/utils/noting/find-entire-note.js#L23)\r\n\r\nWhen [this is thrown](https://app.getsentry.com/digital-cms/composer/group/46800924/) we don't get any info about what `focus` actually is. In this sense it's harder to debug what actually happened than if we wouldn't have had it all.\r\n\r\nCould we either:\r\n\r\n1. Standardise on a type check function that will display relevant details like parameters in the error message?\r\n2. Or simply rely on our unit tests instead of these checks?"}}