問題文
A haulier's error-handling design covers detection, recording, retry, notification and giving up. Even so, its three interfaces treat the same failure differently: one retries a payload the endpoint has rejected as invalid, another notifies on a timeout without recording it anywhere. What should the architect add to make the five layers behave consistently?
選択肢
- A weekly review meeting that looks at the failures each interface produced, so that the differences between the three interfaces are noticed by the team and corrected as they come up rather than being designed away in advance.
- A rule that every failure is retried three times before it is raised.
- One table that assigns each class of failure to the layers that handle it, so that a permanent rejection goes to recording, notification and stopping, while a temporary fault goes to recording and retry.
- A shared helper class that every interface calls, which decides at run time what to do by inspecting the response from the endpoint, so that the individual interfaces no longer hold any error handling of their own and future interfaces inherit the behavior without further work.