diff options
author | schu <schu-github@schulog.org> | 2011-05-11 12:09:40 +0200 |
---|---|---|
committer | schu <schu-github@schulog.org> | 2011-05-11 12:39:31 +0200 |
commit | cbcaf0c09cd50ee705ea9740d57b722900f4e723 (patch) | |
tree | 3ad4066cd18df4358ab10660773186027887f17f /src/blob.c | |
parent | 40774549e14e2d9f24b9271173d58b44f82d5254 (diff) | |
download | libgit2-cbcaf0c09cd50ee705ea9740d57b722900f4e723.tar.gz |
Move blob.c to the new error handling
Signed-off-by: schu <schu-github@schulog.org>
Diffstat (limited to 'src/blob.c')
-rw-r--r-- | src/blob.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/blob.c b/src/blob.c index 5e3c22fbf..987169358 100644 --- a/src/blob.c +++ b/src/blob.c @@ -62,7 +62,7 @@ int git_blob_create_frombuffer(git_oid *oid, git_repository *repo, const void *b git_odb_stream *stream; if ((error = git_odb_open_wstream(&stream, repo->db, len, GIT_OBJ_BLOB)) < GIT_SUCCESS) - return error; + return git__rethrow(error, "Failed to create blob. Can't open write stream"); stream->write(stream, buffer, len); @@ -81,7 +81,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat git_odb_stream *stream; if (repo->path_workdir == NULL) - return GIT_ENOTFOUND; + return git__throw(GIT_ENOTFOUND, "Failed to create blob. No workdir given"); git__joinpath(full_path, repo->path_workdir, path); @@ -106,7 +106,7 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat if (read_len < 0) { gitfo_close(fd); stream->free(stream); - return GIT_EOSERR; + return git__throw(GIT_EOSERR, "Failed to create blob. Can't read full file"); } stream->write(stream, buffer, read_len); |