{"action":"created","issue":{"url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1125","repository_url":"https://api.github.com/repos/PerlDancer/Dancer2","labels_url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1125/labels{/name}","comments_url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1125/comments","events_url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1125/events","html_url":"https://github.com/PerlDancer/Dancer2/issues/1125","id":131007923,"number":1125,"title":"Current use of Return::MultiLevel silently and unexpectedly breaks program flow","user":{"login":"ribasushi","id":356110,"avatar_url":"https://avatars.githubusercontent.com/u/356110?v=3","gravatar_id":"","url":"https://api.github.com/users/ribasushi","html_url":"https://github.com/ribasushi","followers_url":"https://api.github.com/users/ribasushi/followers","following_url":"https://api.github.com/users/ribasushi/following{/other_user}","gists_url":"https://api.github.com/users/ribasushi/gists{/gist_id}","starred_url":"https://api.github.com/users/ribasushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ribasushi/subscriptions","organizations_url":"https://api.github.com/users/ribasushi/orgs","repos_url":"https://api.github.com/users/ribasushi/repos","events_url":"https://api.github.com/users/ribasushi/events{/privacy}","received_events_url":"https://api.github.com/users/ribasushi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-02-03T12:21:29Z","updated_at":"2016-02-04T15:38:10Z","closed_at":null,"body":"While on its surface https://github.com/PerlDancer/Dancer2/pull/485 is a good idea, it comes with a huge footgun [as can be seen here](https://github.com/dbsrgits/dbix-class/blob/7cb358520/t/35exception_inaction.t#L74-L86)\r\n\r\nThe real-life implication of this is that anyone following [the advice in Dancer2::Plugin::LogReport](https://metacpan.org/pod/release/MARKOV/Log-Report-1.12/lib/Dancer2/Plugin/LogReport.pod#Logging-DBIC-database-queries-and-errors) completely breaks their DBIC retry logic and possibly other parts of their model, as the internals are not prepared for longjmp's from the middle of its exception stacks.\r\n\r\nWhile [detecting the problem is relatively easy](https://github.com/dbsrgits/dbix-class/blob/7cb358520/lib/DBIx/Class/Schema.pm#L1060-L1116), protecting a large project from this [is extremely involved](https://github.com/dbsrgits/dbix-class/commit/ddcc02d1) (and expensive performance-wise).\r\n\r\nI strongly recommend that the use of `Return::MultiLevel` is re-thought in light of this.\r\n\r\nHighlighting @markov2 and @abeverley in case they decide to change `D2::P::LR` ahead of `D2` itself."},"comment":{"url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/comments/179904404","html_url":"https://github.com/PerlDancer/Dancer2/issues/1125#issuecomment-179904404","issue_url":"https://api.github.com/repos/PerlDancer/Dancer2/issues/1125","id":179904404,"user":{"login":"hvoers","id":171795,"avatar_url":"https://avatars.githubusercontent.com/u/171795?v=3","gravatar_id":"","url":"https://api.github.com/users/hvoers","html_url":"https://github.com/hvoers","followers_url":"https://api.github.com/users/hvoers/followers","following_url":"https://api.github.com/users/hvoers/following{/other_user}","gists_url":"https://api.github.com/users/hvoers/gists{/gist_id}","starred_url":"https://api.github.com/users/hvoers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvoers/subscriptions","organizations_url":"https://api.github.com/users/hvoers/orgs","repos_url":"https://api.github.com/users/hvoers/repos","events_url":"https://api.github.com/users/hvoers/events{/privacy}","received_events_url":"https://api.github.com/users/hvoers/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T15:38:10Z","updated_at":"2016-02-04T15:38:10Z","body":"\n\nOn Thu, 4 Feb 2016, Sawyer X wrote:\n\n> @markov2 What `Return::MultiLevel` provides is the removal of the `return` statement. This gives the DSL a smooth experience. Also, it prevents misunderstands (\"why doesn't `send_error` work?\" \"Because you need to call `return`\" <- that doesn't exist anymore).\n\n[FWIW]\nIn my code I love the 'return'. It shows where the execution stops.\n\n   return redirect '/foo/bar' if some_condition;\n   return template( ... ) if some_other_condition;\n   return template( other ...);\n\n"}}