Introduce recoverable and not recoverable exceptions conception to Connectors

XMLWordPrintable

    • Type: Improvement
    • Resolution: Unresolved
    • None
    • Affects Version/s: None
    • Component/s: LanguageResources

      Originally issue was found in class editor_Models_LanguageResources_Worker 

      try {
          $connector->update($segment);
      } catch (ZfExtended_Zendoverwrites_Http_Exception|editor_Services_Connector_Exception) {
          //if the TM is not available (due service restart or whatever) we just wait some time and try it again once.
          sleep(30);
          $connector->update($segment);
      }
      

      The problem is that there is no distinguishing between errors that can appear inside the update call since they can be "recoverable" and "not recoverable". A recoverable error is something that can be self-fixed after some time, e.g. request timeout because the system overload etc. Not recoverable error is something that can not self-recover e.g. inappropriately configured TM service endpoint.

      The second problem if that code in the example relays on ZfExtended_Zendoverwrites_Http_Exception which should not be the case since it opens code implementation. That should be changed to a particular exceptions that connector can throw.

      What should be done:
      Connectors should be changed to throw specific exceptions of different type so the code outside could understand if the error should be treated as permanent or as temporary.

            Assignee:
            Leon Kiz
            Reporter:
            Leon Kiz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: