I think this is the right way to go about it. We just need to `giterr_set` a descriptive error message and this is good to go.