pimcore icon indicating copy to clipboard operation
pimcore copied to clipboard

Remove useless exception handling in Area(Block)::buildInfoObject()

Open jdreesen opened this issue 2 years ago • 1 comments

The exception handling in Area(Block)::buildInfoObject() was rather useless.

In Area, $info was set to null in case of an error, but later $info->setParams(...) gets called, which would crash.

In Areablock, an error was logged if one of the first three setters failed (which is rather unlikely), and I think it'll be better to fail hard in this case.


I also simplified the code to determine the $params a bit.

jdreesen avatar Sep 09 '22 13:09 jdreesen

Review Checklist

  • [x] Target branch (10.5 for bug fixes, others 11.x)
  • [x] Tests (if it's testable code, there should be a test for it - get help)
  • [x] Docs (every functionality needs to be documented, see here)
  • [x] Migration incl. install.sql (e.g. if the database schema changes, ...)
  • [x] Upgrade notes (deprecations, important information, migration hints, ...)
  • [x] Label
  • [x] Milestone

github-actions[bot] avatar Sep 09 '22 13:09 github-actions[bot]

@jdreesen Thank you!

aryaantony92 avatar Sep 23 '22 07:09 aryaantony92