webfactory / WebfactoryPolyglotBundle

Symfony bundle simplifying translations in Doctrine.
MIT License
3 stars 2 forks source link

Logger introduced in Polyglot and exceptions inside the translate function are passed to it #3

Closed dword-design closed 8 years ago

dword-design commented 8 years ago

Initial situation:

  1. No logging was available
  2. Exceptions thrown inside the translate function could not be exposed because PHP forbids __toString (which calls translate) to throw exceptions

Now:

  1. A logger is passed from the PolyglotListener via the ClassMetadata to the ManagedTranslationProxy
  2. Exceptions thrown inside the translate function are wrapped by a new TranslationException class and passed to the logger if one is available.
coveralls commented 8 years ago

Coverage Status

Coverage increased (+11.1%) to 84.632% when pulling 7253f8f749b3dd572dbd939c6da45ebe0e45ae85 on bugfix/1_exceptions_in_managed_translation_proxy into 1e20a8c46af905f882f1d745d4782caf44ee817d on master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+11.1%) to 84.632% when pulling 7253f8f749b3dd572dbd939c6da45ebe0e45ae85 on bugfix/1_exceptions_in_managed_translation_proxy into 1e20a8c46af905f882f1d745d4782caf44ee817d on master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+11.1%) to 84.632% when pulling d78b64fdb5d94805caf08b77946bae43be975fed on bugfix/1_exceptions_in_managed_translation_proxy into 1e20a8c46af905f882f1d745d4782caf44ee817d on master.