python-tuf icon indicating copy to clipboard operation
python-tuf copied to clipboard

Add exception handling guidelines

Open lukpueh opened this issue 5 years ago • 4 comments
trafficstars

Which exceptions should be handled, which exceptions should be propagated to the user? When should we use custom exceptions, when should we use built-in exceptions? etc...

The Google Python style-guide has some reasonable suggestions about exceptions.

lukpueh avatar Sep 10 '20 08:09 lukpueh

See related #967

lukpueh avatar Sep 10 '20 10:09 lukpueh

Don't you think this issue needs a label decision record ? When you create guidelines for something used in multiple places like exceptions maybe it's a good idea to record it.

Same question for issues https://github.com/theupdateframework/tuf/issues/1132, https://github.com/theupdateframework/tuf/issues/1130, https://github.com/theupdateframework/tuf/issues/1129 and https://github.com/theupdateframework/tuf/issues/1125.

MVrachev avatar Sep 23 '20 15:09 MVrachev

I'm not sure if it's deserving of a separate label, but we should make it clear that the result of every discussion should be documented. Whether a decision record, contributor guideline or some other form.

joshuagl avatar Sep 28 '20 10:09 joshuagl

Good point @MVrachev. But how would the decision record about exception guidelines differ from the exception guideline document itself? I think the reason why I didn't use the label here is because I envisioned the guideline document itself a good central place that justifies the way exceptions are handled in multiple places, and probably this issue page as easily identifiable place to look up any additional discussion, that are not part of the guideline document.

That said, I do see how it's not always clear if something classifies for a decision record or not. A general rule of thumb to classify something could be:

"The decision is worth being tracked and there is no easily identifiable place (e.g. PR or issue page, commit message, code comment, other documentation or guideline, etc...) for it to be tracked at."

What do you think? At any rate, we should make this clear as part of #1141.

lukpueh avatar Sep 28 '20 13:09 lukpueh