diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-05-09 14:44:08 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-05-09 14:44:08 -0400 |
commit | 6a3a87a714e1f3be1464f8fd4c82714b7d032879 (patch) | |
tree | 4a8a911a6f026578e78bc120869451f5bbe95056 /src/libstore/content-address.hh | |
parent | e514b3939adb087338a9ef7445afcecb0efb42b1 (diff) |
Improve error message for self reference with text hashing
The `ContentAddressWithReferences` method is made total, with error
handling now squarely the caller's job. This is better.
Diffstat (limited to 'src/libstore/content-address.hh')
-rw-r--r-- | src/libstore/content-address.hh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstore/content-address.hh b/src/libstore/content-address.hh index 03a2e2a23..e1e80448b 100644 --- a/src/libstore/content-address.hh +++ b/src/libstore/content-address.hh @@ -303,10 +303,11 @@ struct ContentAddressWithReferences * * @param refs References to other store objects or oneself. * - * Do note that not all combinations are supported. + * Do note that not all combinations are supported; `nullopt` is + * returns for invalid combinations. */ - static ContentAddressWithReferences fromParts( - ContentAddressMethod method, Hash hash, StoreReferences refs); + static std::optional<ContentAddressWithReferences> fromPartsOpt( + ContentAddressMethod method, Hash hash, StoreReferences refs) noexcept; ContentAddressMethod getMethod() const; |