{"action":"created","issue":{"url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7","labels_url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7/comments","events_url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7/events","html_url":"https://github.com/aminroosta/sqlite_modern_cpp/issues/7","id":66843594,"number":7,"title":"Exceptions","user":{"login":"Killili","id":451325,"avatar_url":"https://avatars.githubusercontent.com/u/451325?v=3","gravatar_id":"","url":"https://api.github.com/users/Killili","html_url":"https://github.com/Killili","followers_url":"https://api.github.com/users/Killili/followers","following_url":"https://api.github.com/users/Killili/following{/other_user}","gists_url":"https://api.github.com/users/Killili/gists{/gist_id}","starred_url":"https://api.github.com/users/Killili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Killili/subscriptions","organizations_url":"https://api.github.com/users/Killili/orgs","repos_url":"https://api.github.com/users/Killili/repos","events_url":"https://api.github.com/users/Killili/events{/privacy}","received_events_url":"https://api.github.com/users/Killili/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-07T10:00:53Z","updated_at":"2015-05-19T10:45:25Z","closed_at":null,"body":"Hi,\r\n\r\nnow that we have the stuff from @KnairdA  (thx) i would like to purpose some changes ;) \r\n\r\nFirst i would like to introduce a new exception and then i would like to make it easier to decide if it is a error or a suggestion.\r\n\r\nI have a exception that is thrown in _extract if the query did not return a row but a function was given to handle one. The purpose of this is to make sure that the function was called or that vales are realy assigned to the \"output\" variables.\r\n\r\nBut in other cases it might not be a error that nothing is returned, so i made it a 'sqlite::data_exception' and if its handled properly it can be ignored. I did the same to the \"not all rows handled\" exception.\r\n\r\nDo you think it fits the spirit of this lib?\r\nAnd if so should we convert the std::runtime_error for sql errors to a special exception, too?\r\n"},"comment":{"url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/comments/103433757","html_url":"https://github.com/aminroosta/sqlite_modern_cpp/issues/7#issuecomment-103433757","issue_url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7","id":103433757,"user":{"login":"aminroosta","id":2920178,"avatar_url":"https://avatars.githubusercontent.com/u/2920178?v=3","gravatar_id":"","url":"https://api.github.com/users/aminroosta","html_url":"https://github.com/aminroosta","followers_url":"https://api.github.com/users/aminroosta/followers","following_url":"https://api.github.com/users/aminroosta/following{/other_user}","gists_url":"https://api.github.com/users/aminroosta/gists{/gist_id}","starred_url":"https://api.github.com/users/aminroosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aminroosta/subscriptions","organizations_url":"https://api.github.com/users/aminroosta/orgs","repos_url":"https://api.github.com/users/aminroosta/repos","events_url":"https://api.github.com/users/aminroosta/events{/privacy}","received_events_url":"https://api.github.com/users/aminroosta/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T10:45:24Z","updated_at":"2015-05-19T10:45:24Z","body":"using `*` and `+` operators will do the job ( and i think introducing new operators is the way to extend the framework).\r\nbut at the same time , i also think that the difference between the new operators should be much more than just throwing or not throwing exceptions.\r\n( passing a simple flag to the constructor of database ... ? ).\r\n\r\nI have two other scenarios/solutions in my mind.  \r\nI will write a `pseudocode` code to explain them :\r\n\r\n```c++\r\n     enum sqlite_command {\r\n           not_throw_at_all;\r\n           throw_if_lambda_not_executed;\r\n           throw_??? ;\r\n     }\r\n\r\n     db <<  not_throw_at_all << \"select * from test\"  >> [&](int val) { /* do something */ }\r\n```\r\n\r\nand another idea (which i borrowed from `nodejs`).\r\n```c++\r\n     enum sqlite_errorcode {\r\n            ok;\r\n            not_all_rows_read;\r\n            query_invalid;\r\n            ???;\r\n    }\r\n    db << \"select * from test\" >> [&](sqlite_errorcode e, int val) { if (e != ok) {  }  }\r\n\r\n    // or just something simpler like this\r\n    db << \"select * from test\" >> [&](bool error_happend, int val) {\r\n             if(error_happend)\r\n                     var msg = db.last_error(); \r\n    }\r\n   db << \"insert int test(a,b) values( ?, ?);\" << \"A\" << \"B\" >> [&](bool error) { if(error) { /* */ } };\r\n```\r\n \r\n_just some ideas_ **but** if you think introducing `*` and `+` operators are a better way to go, i'm in !"}}