{"action":"created","issue":{"url":"https://api.github.com/repos/George3d6/Inquisitor/issues/19","repository_url":"https://api.github.com/repos/George3d6/Inquisitor","labels_url":"https://api.github.com/repos/George3d6/Inquisitor/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/George3d6/Inquisitor/issues/19/comments","events_url":"https://api.github.com/repos/George3d6/Inquisitor/issues/19/events","html_url":"https://github.com/George3d6/Inquisitor/issues/19","id":310118650,"number":19,"title":"Error handling for plugin initialization & ready methods","user":{"login":"George3d6","id":23587658,"avatar_url":"https://avatars3.githubusercontent.com/u/23587658?v=4","gravatar_id":"","url":"https://api.github.com/users/George3d6","html_url":"https://github.com/George3d6","followers_url":"https://api.github.com/users/George3d6/followers","following_url":"https://api.github.com/users/George3d6/following{/other_user}","gists_url":"https://api.github.com/users/George3d6/gists{/gist_id}","starred_url":"https://api.github.com/users/George3d6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/George3d6/subscriptions","organizations_url":"https://api.github.com/users/George3d6/orgs","repos_url":"https://api.github.com/users/George3d6/repos","events_url":"https://api.github.com/users/George3d6/events{/privacy}","received_events_url":"https://api.github.com/users/George3d6/received_events","type":"User","site_admin":false},"labels":[{"id":843420256,"url":"https://api.github.com/repos/George3d6/Inquisitor/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"open","locked":false,"assignee":{"login":"Deedasmi","id":5093293,"avatar_url":"https://avatars0.githubusercontent.com/u/5093293?v=4","gravatar_id":"","url":"https://api.github.com/users/Deedasmi","html_url":"https://github.com/Deedasmi","followers_url":"https://api.github.com/users/Deedasmi/followers","following_url":"https://api.github.com/users/Deedasmi/following{/other_user}","gists_url":"https://api.github.com/users/Deedasmi/gists{/gist_id}","starred_url":"https://api.github.com/users/Deedasmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deedasmi/subscriptions","organizations_url":"https://api.github.com/users/Deedasmi/orgs","repos_url":"https://api.github.com/users/Deedasmi/repos","events_url":"https://api.github.com/users/Deedasmi/events{/privacy}","received_events_url":"https://api.github.com/users/Deedasmi/received_events","type":"User","site_admin":false},"assignees":[{"login":"Deedasmi","id":5093293,"avatar_url":"https://avatars0.githubusercontent.com/u/5093293?v=4","gravatar_id":"","url":"https://api.github.com/users/Deedasmi","html_url":"https://github.com/Deedasmi","followers_url":"https://api.github.com/users/Deedasmi/followers","following_url":"https://api.github.com/users/Deedasmi/following{/other_user}","gists_url":"https://api.github.com/users/Deedasmi/gists{/gist_id}","starred_url":"https://api.github.com/users/Deedasmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deedasmi/subscriptions","organizations_url":"https://api.github.com/users/Deedasmi/orgs","repos_url":"https://api.github.com/users/Deedasmi/repos","events_url":"https://api.github.com/users/Deedasmi/events{/privacy}","received_events_url":"https://api.github.com/users/Deedasmi/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/George3d6/Inquisitor/milestones/1","html_url":"https://github.com/George3d6/Inquisitor/milestone/1","labels_url":"https://api.github.com/repos/George3d6/Inquisitor/milestones/1/labels","id":3231514,"number":1,"title":"Release 0.3.0","description":"Get ready for the 0.3.1 release, once this release is ready a bit of cleanup and testing will be done and 0.3.2 (more stable with video docs will be underway)\r\n","creator":{"login":"George3d6","id":23587658,"avatar_url":"https://avatars3.githubusercontent.com/u/23587658?v=4","gravatar_id":"","url":"https://api.github.com/users/George3d6","html_url":"https://github.com/George3d6","followers_url":"https://api.github.com/users/George3d6/followers","following_url":"https://api.github.com/users/George3d6/following{/other_user}","gists_url":"https://api.github.com/users/George3d6/gists{/gist_id}","starred_url":"https://api.github.com/users/George3d6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/George3d6/subscriptions","organizations_url":"https://api.github.com/users/George3d6/orgs","repos_url":"https://api.github.com/users/George3d6/repos","events_url":"https://api.github.com/users/George3d6/events{/privacy}","received_events_url":"https://api.github.com/users/George3d6/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":0,"state":"open","created_at":"2018-03-30T17:05:40Z","updated_at":"2018-03-30T17:34:26Z","due_on":"2018-03-30T07:00:00Z","closed_at":null},"comments":4,"created_at":"2018-03-30T17:11:34Z","updated_at":"2018-03-30T18:02:19Z","closed_at":null,"author_association":"OWNER","body":"Plugins should never crash the agent if initialization and/or ready doesn't work, instead it should just log and error, same goes for the receptor.,"},"comment":{"url":"https://api.github.com/repos/George3d6/Inquisitor/issues/comments/377584258","html_url":"https://github.com/George3d6/Inquisitor/issues/19#issuecomment-377584258","issue_url":"https://api.github.com/repos/George3d6/Inquisitor/issues/19","id":377584258,"user":{"login":"Deedasmi","id":5093293,"avatar_url":"https://avatars0.githubusercontent.com/u/5093293?v=4","gravatar_id":"","url":"https://api.github.com/users/Deedasmi","html_url":"https://github.com/Deedasmi","followers_url":"https://api.github.com/users/Deedasmi/followers","following_url":"https://api.github.com/users/Deedasmi/following{/other_user}","gists_url":"https://api.github.com/users/Deedasmi/gists{/gist_id}","starred_url":"https://api.github.com/users/Deedasmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deedasmi/subscriptions","organizations_url":"https://api.github.com/users/Deedasmi/orgs","repos_url":"https://api.github.com/users/Deedasmi/repos","events_url":"https://api.github.com/users/Deedasmi/events{/privacy}","received_events_url":"https://api.github.com/users/Deedasmi/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T18:02:19Z","updated_at":"2018-03-30T18:02:19Z","author_association":"COLLABORATOR","body":"So #21 is the PR that returns those bad errors if plugin authors don't follow the not-yet-created plugin creation guide. I do think this is acceptable under RTFM. \r\n\r\nThe thing about this PR, and why I would like to go this route, is I'm not requiring authors to return a `Result<Plugin, String>`. They can return any type that implements AgentPlugin, and any error that implements Display. The benefit is that they could return any type of error they wanted, as long as it was printable. You can change file_checker::new() into returning a std::io::Error if you wanted. Or a failure::Error, or anything else. Here is a quick example:\r\n\r\n```\r\npub fn new() -> Result<Plugin, std::io::Error> {\r\n    let mut new_plugin = Plugin {\r\n        enabled: false,\r\n        last_call_ts: 0,\r\n        periodicity: 0,\r\n        file_info_map: HashMap::new(),\r\n    };\r\n    Plugin::config(&mut new_plugin);\r\n    if new_plugin.enabled {\r\n        Ok(new_plugin)\r\n    } else {\r\n        Err(std::io::Error::from(std::io::ErrorKind::NotFound))\r\n    }\r\n}\r\n```\r\n\r\n>Alive successfully loaded\r\n>Command runner disabled\r\n>entity not found\r\n\r\nI feel like this makes things more flexible, since all we really want to do is log their error anyway. "}}
{"actor":{"display_login":"Deedasmi"}}