{"action":"created","issue":{"url":"https://api.github.com/repos/EvotecIT/PSWinReporting/issues/13","repository_url":"https://api.github.com/repos/EvotecIT/PSWinReporting","labels_url":"https://api.github.com/repos/EvotecIT/PSWinReporting/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/EvotecIT/PSWinReporting/issues/13/comments","events_url":"https://api.github.com/repos/EvotecIT/PSWinReporting/issues/13/events","html_url":"https://github.com/EvotecIT/PSWinReporting/issues/13","id":375828506,"node_id":"MDU6SXNzdWUzNzU4Mjg1MDY=","number":13,"title":"Error handling","user":{"login":"snd3r","id":13349072,"node_id":"MDQ6VXNlcjEzMzQ5MDcy","avatar_url":"https://avatars2.githubusercontent.com/u/13349072?v=4","gravatar_id":"","url":"https://api.github.com/users/snd3r","html_url":"https://github.com/snd3r","followers_url":"https://api.github.com/users/snd3r/followers","following_url":"https://api.github.com/users/snd3r/following{/other_user}","gists_url":"https://api.github.com/users/snd3r/gists{/gist_id}","starred_url":"https://api.github.com/users/snd3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snd3r/subscriptions","organizations_url":"https://api.github.com/users/snd3r/orgs","repos_url":"https://api.github.com/users/snd3r/repos","events_url":"https://api.github.com/users/snd3r/events{/privacy}","received_events_url":"https://api.github.com/users/snd3r/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-10-31T07:15:03Z","updated_at":"2018-11-01T07:12:21Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Hi @PrzemyslawKlys, I have a question about error handling.\r\n\r\nIn the powershell, the error handler only works if the ErrorAction flag is set, or the global variable ErrorActionPreference is set to 'Stop'.\r\n\r\nIn this cases, error code handling doesn't work.:\r\nhttps://github.com/EvotecIT/PSWinReporting/blob/cba6408fe39e614630bfcf917d79e9b6ed832bab/Private/Get-EventLogSize.ps1#L11\r\nhttps://github.com/EvotecIT/PSWinReporting/blob/cba6408fe39e614630bfcf917d79e9b6ed832bab/Private/Test-Prerequisite.ps1#L51\r\n\r\nI think the good way is to remove all the 'ErrorAction' arguments and set the global variable ErrorActionPreference.\r\n\r\nThis way will help us catch two birds with one stone:\r\n - No need to remember about ErrorAction\r\n - Any other error in runtime will stop the script\r\n"},"comment":{"url":"https://api.github.com/repos/EvotecIT/PSWinReporting/issues/comments/434953049","html_url":"https://github.com/EvotecIT/PSWinReporting/issues/13#issuecomment-434953049","issue_url":"https://api.github.com/repos/EvotecIT/PSWinReporting/issues/13","id":434953049,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDk1MzA0OQ==","user":{"login":"PrzemyslawKlys","id":15063294,"node_id":"MDQ6VXNlcjE1MDYzMjk0","avatar_url":"https://avatars1.githubusercontent.com/u/15063294?v=4","gravatar_id":"","url":"https://api.github.com/users/PrzemyslawKlys","html_url":"https://github.com/PrzemyslawKlys","followers_url":"https://api.github.com/users/PrzemyslawKlys/followers","following_url":"https://api.github.com/users/PrzemyslawKlys/following{/other_user}","gists_url":"https://api.github.com/users/PrzemyslawKlys/gists{/gist_id}","starred_url":"https://api.github.com/users/PrzemyslawKlys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrzemyslawKlys/subscriptions","organizations_url":"https://api.github.com/users/PrzemyslawKlys/orgs","repos_url":"https://api.github.com/users/PrzemyslawKlys/repos","events_url":"https://api.github.com/users/PrzemyslawKlys/events{/privacy}","received_events_url":"https://api.github.com/users/PrzemyslawKlys/received_events","type":"User","site_admin":false},"created_at":"2018-11-01T07:12:21Z","updated_at":"2018-11-01T07:12:21Z","author_association":"MEMBER","body":"Sure. Send it over. The one you sent looks good. I can accept this one and you can push more changes."}}
{"actor":{"display_login":"PrzemyslawKlys"}}