Review main Merged

50455[BUGFIX] Always log exception data if file handling fails

Markus Klein CR +2 V +2 Easy +2 −2 updated 11/01/16, 11:47

Commit message

If file handling fails in ContentObjectRenderer the log message
must contain also the exception information, otherwise the
whole error message is useless.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Jörg Bösche +1
    • Andreas Kienast +1
    • Philipp Gampe +1
  • Verified V +2
    • Christian Kuhn +2
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1011

  1. Markus Klein uploaded patch set 1 10/31/16, 15:20

  2. TYPO3com voted on patch set 1 V +1 10/31/16, 15:25 Completed build in 04m 58s on Mon, 31 Oct, 04:25 PM Test Summary: 54741 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4481

  3. Jörg Bösche voted on patch set 1 CR +1 10/31/16, 15:37

  4. Andreas Kienast voted on patch set 1 CR +1 10/31/16, 18:11

  5. Tymoteusz Motylewski commented on patch set 1 10/31/16, 20:46

    Markus, can you add some testing instructions?
  6. Markus Klein commented on patch set 1 11/01/16, 00:00

    Well, for testing you must create a broken file reference. Eg via TS. Or, as in our case, use a broken extension, that uses an imgresource with a wrong path.
  7. Christian Kuhn commented on patch set 1 CR +1 V +1 11/01/16, 11:25

    ContentObjectRenderer.php:5184

    explanation why that works: ->warning() creates a "LogRecord" from second argument $data, which is later given to a "LogWriter". The writers check $data['exception'] and cast that to (string), which triggers __toString() of \Exception.
  8. Philipp Gampe voted on patch set 1 CR +1 11/01/16, 11:31

  9. Christian Kuhn commented on patch set 1 CR +2 V +2 11/01/16, 11:47

    i'll merge that now, even with a missing vote on testing: this is rather unfunny to test, but code wise it is rather obvious ... get it done ...
  10. Gerrit merged patch set 1 11/01/16, 11:47

  11. Christian Kuhn commented on patch set 2 11/01/16, 11:47

    Cherry Picked This patchset was cherry picked to branch TYPO3_7-6 as commit b295382cfde1b515b5767900af9629501ebbfb0e