{"action":"created","issue":{"url":"https://api.github.com/repos/TedStudley/mc-mini/issues/30","labels_url":"https://api.github.com/repos/TedStudley/mc-mini/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/TedStudley/mc-mini/issues/30/comments","events_url":"https://api.github.com/repos/TedStudley/mc-mini/issues/30/events","html_url":"https://github.com/TedStudley/mc-mini/pull/30","id":123585993,"number":30,"title":"Exception Improvements","user":{"login":"TedStudley","id":1839547,"avatar_url":"https://avatars.githubusercontent.com/u/1839547?v=3","gravatar_id":"","url":"https://api.github.com/users/TedStudley","html_url":"https://github.com/TedStudley","followers_url":"https://api.github.com/users/TedStudley/followers","following_url":"https://api.github.com/users/TedStudley/following{/other_user}","gists_url":"https://api.github.com/users/TedStudley/gists{/gist_id}","starred_url":"https://api.github.com/users/TedStudley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TedStudley/subscriptions","organizations_url":"https://api.github.com/users/TedStudley/orgs","repos_url":"https://api.github.com/users/TedStudley/repos","events_url":"https://api.github.com/users/TedStudley/events{/privacy}","received_events_url":"https://api.github.com/users/TedStudley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TedStudley/mc-mini/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-23T01:36:20Z","updated_at":"2015-12-29T00:48:10Z","closed_at":"2015-12-28T22:20:38Z","pull_request":{"url":"https://api.github.com/repos/TedStudley/mc-mini/pulls/30","html_url":"https://github.com/TedStudley/mc-mini/pull/30","diff_url":"https://github.com/TedStudley/mc-mini/pull/30.diff","patch_url":"https://github.com/TedStudley/mc-mini/pull/30.patch"},"body":"**Re-worked the exception system to subclass from boost::exception and std::exception**\r\nThe new exception system should be much more robust, as well as allowing us to attach arbitrary information to the exception at the throw site, to be reported when caught.\r\n\r\n**Added an exception handler in `main` using `boost::diagnostic_information`**\r\nException catching/throwing should now give us much more information than before. Compare:\r\n```\r\nlibc++abi.dylib: terminating with uncaught exception of type std::runtime_error: <Error> Opening parameter file \"foo\" failed! Shutting down now.\r\n[1]    96711 abort      ./mc-mini ../exampleParameter\r\n```\r\nto\r\n```\r\n/Users/estudley/Workspace/mc-mini/source/parser/parser.cpp(17): Throw in function ParamParser::ParamParser(const string)\r\nDynamic exception type: boost::exception_detail::clone_impl<RuntimeError>\r\nstd::exception::what: Runtime Error\r\n[tag_trace*] = backtrace() returned 5 addresses:\r\n1   mc-mini                             0x000000010980f3ee _ZN11ParamParserC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 1582\r\n2   mc-mini                             0x0000000109810cf5 _ZN11ParamParserC1ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 21\r\n3   mc-mini                             0x00000001097d8b91 main + 1521\r\n4   libdyld.dylib                       0x00007fff91bd75fd start + 1\r\n\r\n[tag_errmsg*] = Opening parameter file 'foo' failed.\r\n```\r\n\r\n**Added support for stack trace in segfault/exception handling:**\r\nKinda gave this one away in the new error message example. An uncaught exception should now report the stack trace at the throw site, with at least somewhat decent debugging information. Nice symbols *may* not be available by default, in which case they should be able to be turned on with the `-rdynamic` flag.\r\n\r\n**Updated all pre-existing throws to use the new `THROW_WITH_TRACE`:**\r\nAll `throw`s (except ones which are planned to be removed in parser.cpp) have been replaced by the new `THROW_WITH_TRACE` macro, which throws the provided exception after populating its stack trace (and other) information. \r\n\r\n**Disabled Clang support on TravisCI:**\r\nThe versions of Clang and Boost on TravisCI do *not* get along with eachother. I've disabled clang compilation on TravisCI for now, since it won't do anything but cause failure spam."},"comment":{"url":"https://api.github.com/repos/TedStudley/mc-mini/issues/comments/167687045","html_url":"https://github.com/TedStudley/mc-mini/pull/30#issuecomment-167687045","issue_url":"https://api.github.com/repos/TedStudley/mc-mini/issues/30","id":167687045,"user":{"login":"icherkashin","id":8561756,"avatar_url":"https://avatars.githubusercontent.com/u/8561756?v=3","gravatar_id":"","url":"https://api.github.com/users/icherkashin","html_url":"https://github.com/icherkashin","followers_url":"https://api.github.com/users/icherkashin/followers","following_url":"https://api.github.com/users/icherkashin/following{/other_user}","gists_url":"https://api.github.com/users/icherkashin/gists{/gist_id}","starred_url":"https://api.github.com/users/icherkashin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icherkashin/subscriptions","organizations_url":"https://api.github.com/users/icherkashin/orgs","repos_url":"https://api.github.com/users/icherkashin/repos","events_url":"https://api.github.com/users/icherkashin/events{/privacy}","received_events_url":"https://api.github.com/users/icherkashin/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T00:48:10Z","updated_at":"2015-12-29T00:48:10Z","body":"I agree: these changes look very useful!"}}