{"action":"created","issue":{"url":"https://api.github.com/repos/alexbrainman/odbc/issues/76","repository_url":"https://api.github.com/repos/alexbrainman/odbc","labels_url":"https://api.github.com/repos/alexbrainman/odbc/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/alexbrainman/odbc/issues/76/comments","events_url":"https://api.github.com/repos/alexbrainman/odbc/issues/76/events","html_url":"https://github.com/alexbrainman/odbc/issues/76","id":171661345,"number":76,"title":"Use of panic in source code","user":{"login":"MarkSonghurst","id":12572381,"avatar_url":"https://avatars.githubusercontent.com/u/12572381?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkSonghurst","html_url":"https://github.com/MarkSonghurst","followers_url":"https://api.github.com/users/MarkSonghurst/followers","following_url":"https://api.github.com/users/MarkSonghurst/following{/other_user}","gists_url":"https://api.github.com/users/MarkSonghurst/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkSonghurst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkSonghurst/subscriptions","organizations_url":"https://api.github.com/users/MarkSonghurst/orgs","repos_url":"https://api.github.com/users/MarkSonghurst/repos","events_url":"https://api.github.com/users/MarkSonghurst/events{/privacy}","received_events_url":"https://api.github.com/users/MarkSonghurst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-17T13:46:28Z","updated_at":"2016-08-18T07:24:01Z","closed_at":null,"body":"Hi\r\nI noticed the use of the Go panic() function within the source code, but no recover() functions.\r\nAre the higher level Go database/sql wrappers capturing the panics and recovering, or do I need to support recover() within my daemon when using database/sql with this odbc package?\r\n\r\nThanks for a great package.\r\nMark."},"comment":{"url":"https://api.github.com/repos/alexbrainman/odbc/issues/comments/240644470","html_url":"https://github.com/alexbrainman/odbc/issues/76#issuecomment-240644470","issue_url":"https://api.github.com/repos/alexbrainman/odbc/issues/76","id":240644470,"user":{"login":"alexbrainman","id":9796621,"avatar_url":"https://avatars.githubusercontent.com/u/9796621?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbrainman","html_url":"https://github.com/alexbrainman","followers_url":"https://api.github.com/users/alexbrainman/followers","following_url":"https://api.github.com/users/alexbrainman/following{/other_user}","gists_url":"https://api.github.com/users/alexbrainman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbrainman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbrainman/subscriptions","organizations_url":"https://api.github.com/users/alexbrainman/orgs","repos_url":"https://api.github.com/users/alexbrainman/repos","events_url":"https://api.github.com/users/alexbrainman/events{/privacy}","received_events_url":"https://api.github.com/users/alexbrainman/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T07:24:01Z","updated_at":"2016-08-18T07:24:01Z","body":"> Are the higher level Go database/sql wrappers capturing the panics and recovering,\r\n\r\nI don't think so.\r\n\r\n> do I need to support recover() within my daemon when using database/sql with this odbc package?\r\n\r\nYou are not expected to catch panics in odbc package. I expect your program will crash and print stack trace, and you will report the problem, and we will try to understand what happened.\r\n\r\n> If I raise a PR which replaces the use of panic in your code with the returning of an error type is that ok, or are you using panic for a specific reason?\r\n\r\nI looked at all current panics in the code. They all safeguard against \"programmer errors\" (safety checks). If I know I made mistake in the code, should I continue?\r\n\r\nAlso the package is designed to talk to any ODBC compliant driver. But, personally, I have used just a few drivers. I wouldn't know how different drivers behave in corner cases. I don't want my code to continue, if ODBC driver behaves in an expected (or unknown to me) way.\r\n\r\nFeel free to try and convert panics into errors, but I am not convinced it will improve the situation. What will your program do, if some odbc package function returns one of those \"I don't understand how I end-up in this situation\" errors?\r\n\r\nDid you actually see any of these panics in real life? I didn't. And I don't remember them reported by others.\r\n\r\nAlex"}}
{"actor":{"display_login":"alexbrainman"}}