Throw NotFound and CannotDereference Exceptions - Reborn#842
Throw NotFound and CannotDereference Exceptions - Reborn#842
Conversation
|
Depends on libgit2/libgit2#2627 |
|
Now that libgit2/libgit2#2718 has been merged, we should be able to more easily distinguish root cause of peeling issues. |
|
Does this need to go on top of #870 ? |
49987df to
cdc4afc
Compare
cdc4afc to
a75c2ce
Compare
|
Looking more closely at this - I don't think the second commit (a75c2c2e) is needed anymore. What we probably need to do instead is update the documentation around |
a75c2ce to
7b10d60
Compare
|
@jamill I hear you and I agree, however I'm a bit "dry" when it comes to enhancing the exception xml doc. Any idea? FWIW, I've added some code coverage regarding the lookup of wrong revparse expression. Does it feel ok? |
7b10d60 to
2a72135
Compare
There was a problem hiding this comment.
Seems fine to me. If an app cares about the difference between the errors, it can tell the user what went wrong more specifically.
There was a problem hiding this comment.
I don't know if the ability to discern between these two cases is actually worth the complexity of having two exceptions that are pretty similar (they both mean I can peel the object as requested). However, everything is working as designed in libgit2 - I wouldn't argue to change the current design unless we get feedback that this is confusing.
f629c71 to
f3f96ea
Compare
I can take a pass at updating the xml docs in a bit. I will tack it on the end of this PR. |
@jamill ❤️ |
|
Does anyone oppose to see this merged? |
|
I hereby grant you permission to break API! |
This change is to throw more specific exceptions in several cases when possible. If an object cannot be found, throw a more specific NotFoundException.
Update documentation on InvalidSpecificationException to better reflect the current meaning of this exception.
30485a4 to
24446f5
Compare
|
Let's do this, then 💥 |
Throw NotFound and CannotDereference Exceptions - Reborn
This change is to throw more specific exceptions in several cases when
possible. If an object cannot be found, throw a more specific
NotFoundException. If an object exists but cannot be dereferenced to its
desired type, then throw a CannotDereferenceException.
This is the rebirth of #839 that has been too hastily merged (then reverted). 😊