tor-keymgr: Rework KeyPathError
The following discussion from !1784 (merged) should be addressed:
-
@Diziet started a discussion: (+2 comments) I don't think I approve of the error handling in this function.
I think key info extractors are not supposed to overlap. So if extractor.describe returns any error other than "this ArtiPath isn't for me", that error should probably be returned.
The variants in
KeyPathError
are confusing, too, in this context. I'm not sure why it needs two "not recognised" variants. (With this function here as it is, it can only returnUnrecognized
and no-one else can ever return that, in which case that variant ought to be its own enum, but as I say I think this error handling is wrong...)