MSPF-91: crash if checkout_object returned 'object_not_found' (#42)

This commit is contained in:
Evgeny Levenets 2016-10-21 12:27:12 +03:00 committed by GitHub
parent f26fa86b8d
commit d1d631c791

View File

@ -47,9 +47,14 @@ all(Revision) ->
-spec get(revision(), ref()) -> data().
get(Revision, Ref) ->
#'VersionedObject'{object = Object} = dmt_client:checkout_object({version, Revision}, Ref),
{_Tag, {_Name, _Ref, Data}} = Object,
Data.
try
#'VersionedObject'{object = Object} = dmt_client:checkout_object({version, Revision}, Ref),
{_Tag, {_Name, _Ref, Data}} = Object,
Data
catch
throw:object_not_found ->
error({object_not_found, {Revision, Ref}})
end.
-spec commit(revision(), dmt:commit()) -> ok.