{"data":{"id":"magento2-37712","source":"github-pr","sourceRef":"magento/magento2#37712","title":"Fix exception handling inconsistency between developer and production modes","pr":{"number":37712,"url":"https://github.com/magento/magento2/pull/37712","author":"iGerchak","mergedAt":"2024-05-28T15:06:27Z","mergeCommit":"1d9a2919d6ae228218ab11b6e08f8d7a6e799b2b","headCommit":"03d4568bc7eaa56176cde2155375e8cfdd11e8a2","baseRef":"2.4-develop","diffSha256":"2f06a25b0b5b7e667f7f287d0619d1bcbba546cf1c35629897cb0bbb14710f77"},"issues":[{"number":38639,"url":"https://github.com/magento/magento2/issues/38639","title":"[Issue] Fix exception handling inconsistency between developer and production modes","labels":["Area: Framework","Component: Framework/Exception","Issue: Confirmed","Priority: P2","Progress: done","Reported on 2.4.x","Reproduced on 2.4.x"],"kind":"pr-derived"}],"fixedIn":"2.4.8","containingTags":["2.4.8","2.4.8-p1","2.4.8-p2","2.4.8-p3","2.4.8-p4","2.4.8-p5","2.4.9"],"reportedOn":"2.4.5","codeMatch":{"2.4.6":"clean","2.4.6-p1":"clean","2.4.6-p2":"clean","2.4.6-p3":"clean","2.4.6-p4":"clean","2.4.6-p5":"clean","2.4.6-p6":"clean","2.4.6-p7":"clean","2.4.6-p8":"clean","2.4.6-p9":"clean","2.4.6-p10":"clean","2.4.6-p11":"clean","2.4.6-p12":"clean","2.4.6-p13":"clean","2.4.6-p14":"clean","2.4.6-p15":"clean","2.4.7":"clean","2.4.7-p1":"clean","2.4.7-p2":"clean","2.4.7-p3":"clean","2.4.7-p4":"clean","2.4.7-p5":"clean","2.4.7-p6":"clean","2.4.7-p7":"clean","2.4.7-p8":"clean","2.4.7-p9":"clean","2.4.7-p10":"clean","2.4.8":"conflict","2.4.8-p1":"conflict","2.4.8-p2":"conflict","2.4.8-p3":"conflict","2.4.8-p4":"conflict","2.4.8-p5":"conflict","2.4.9":"conflict"},"affectedVersions":["2.4.6","2.4.6-p1","2.4.6-p2","2.4.6-p3","2.4.6-p4","2.4.6-p5","2.4.6-p6","2.4.6-p7","2.4.6-p8","2.4.6-p9","2.4.6-p10","2.4.6-p11","2.4.6-p12","2.4.6-p13","2.4.6-p14","2.4.6-p15","2.4.7","2.4.7-p1","2.4.7-p2","2.4.7-p3","2.4.7-p4","2.4.7-p5","2.4.7-p6","2.4.7-p7","2.4.7-p8","2.4.7-p9","2.4.7-p10"],"components":["magento/framework"],"files":[{"path":"lib/internal/Magento/Framework/App/ExceptionHandler.php","change":"modified","package":"magento/framework"}],"stripped":{"tests":[],"docs":[],"outsideCode":[]},"linesChanged":1,"mergeBatched":false,"excluded":null,"sections":{"description":"During developing our custom module was found an issue in the developer mode, for example, after implementing `\\Magento\\Customer\\Controller\\AccountInterface` class into the custom controller we got redirected to the login page (as was expected), but on the production on the same flow we got an `internal server error 500`.\nIt happened because the redirect URL was set to the response before the trigger exception and as a result `Location` header was sent to the browser and the browser redirect to the login page instead of the page with an exception message.\nIt's not expected flow between developer and production modes and can cause some issues for production.","stepsToReproduce":null,"expectedResult":null,"actualResult":null,"source":"pr"},"signatures":["use LogicException;","use Magento\\Framework\\Exception\\SessionException;","* @throws LogicException","* @throws SessionException","throw new LogicException(__('Some exception text'));"],"labels":{"area":["Framework"],"component":["Framework/Exception"],"priority":"P2","severity":null,"reportedOn":["2.4.x"]},"categories":[],"triage":{"model":"@cf/cloudflare/clef","requestHash":"bd5084e4b13edeaa811cb043608d9b02cc26a447cebe58830feb5c47863d363d","isBugfix":0.9755,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9599,"feature":0.0075,"refactor":0.0146,"tests_only":0.0081,"docs_only":0.0048,"dependency":0.0051},"confidence":0.9062},"scope":{"score":0.2783,"probabilities":{"0":0.7717,"1":0.1783,"2":0.05},"confidence":0.4448},"risk":{"score":0.601,"probabilities":{"0":0.504,"1":0.391,"2":0.105},"confidence":0.1269},"area":{"choice":"framework","probabilities":{"catalog":0.0062,"checkout":0.0081,"customer":0.0337,"admin":0.0068,"graphql_api":0.0049,"framework":0.9201,"frontend":0.0105,"other":0.0097},"confidence":0.8263},"securityRelevant":0.1192,"reportedVersion":{"choice":"2.4.5","probabilities":{"2.4.0":0.0023,"2.4.0-p1":0.0025,"2.4.1":0.0022,"2.4.1-p1":0.0026,"2.4.2":0.0027,"2.4.2-p1":0.0035,"2.4.2-p2":0.0043,"2.4.3":0.0059,"2.4.3-p1":0.0064,"2.4.3-p2":0.0117,"2.4.3-p3":0.0044,"2.4.4":0.0045,"2.4.4-p1":0.0068,"2.4.4-p10":0.005,"2.4.4-p11":0.005,"2.4.4-p12":0.0048,"2.4.4-p13":0.0038,"2.4.4-p14":0.0056,"2.4.4-p15":0.0045,"2.4.4-p16":0.004,"2.4.4-p17":0.0033,"2.4.4-p18":0.0036,"2.4.4-p2":0.0024,"2.4.4-p3":0.0024,"2.4.4-p4":0.0025,"2.4.4-p5":0.0035,"2.4.4-p6":0.0039,"2.4.4-p7":0.0035,"2.4.4-p8":0.0037,"2.4.4-p9":0.0033,"2.4.5":0.453,"2.4.5-p1":0.0499,"2.4.5-p10":0.012,"2.4.5-p11":0.0176,"2.4.5-p12":0.0133,"2.4.5-p13":0.0095,"2.4.5-p14":0.0127,"2.4.5-p15":0.0101,"2.4.5-p16":0.0155,"2.4.5-p17":0.01,"2.4.5-p2":0.0068,"2.4.5-p3":0.011,"2.4.5-p4":0.012,"2.4.5-p5":0.0111,"2.4.5-p6":0.0101,"2.4.5-p7":0.0112,"2.4.5-p8":0.0102,"2.4.5-p9":0.0045,"2.4.6":0.0082,"2.4.6-p1":0.0075,"2.4.6-p10":0.0064,"2.4.6-p11":0.0047,"2.4.6-p12":0.0045,"2.4.6-p13":0.0049,"2.4.6-p14":0.0045,"2.4.6-p15":0.0045,"2.4.6-p2":0.003,"2.4.6-p3":0.0039,"2.4.6-p4":0.0047,"2.4.6-p5":0.0046,"2.4.6-p6":0.0048,"2.4.6-p7":0.0046,"2.4.6-p8":0.0036,"2.4.6-p9":0.0025,"2.4.7":0.0055,"2.4.7-p1":0.005,"2.4.7-p10":0.0042,"2.4.7-p2":0.0044,"2.4.7-p3":0.0047,"2.4.7-p4":0.0062,"2.4.7-p5":0.0059,"2.4.7-p6":0.0071,"2.4.7-p7":0.0046,"2.4.7-p8":0.0038,"2.4.7-p9":0.0032,"2.4.8":0.0042,"2.4.8-p1":0.0055,"2.4.8-p2":0.0054,"2.4.8-p3":0.0067,"2.4.8-p4":0.0071,"2.4.8-p5":0.0069,"2.4.9":0.0066,"unspecified":0.021},"confidence":0.2022},"backportWorthy":{"score":1.5496,"probabilities":{"0":0.0956,"1":0.2591,"2":0.6453},"confidence":0.239}},"curated":null,"tests":null},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-37712 details"}