MCPcopy Create free account
hub / github.com/libgit2/pygit2 / Error_set_str

Function Error_set_str

src/error.c:105–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104
105PyObject *
106Error_set_str(int err, const char *str)
107{
108 if (err == GIT_ENOTFOUND) {
109 /* KeyError expects the arg to be the missing key. */
110 PyErr_SetString(PyExc_KeyError, str);
111 return NULL;
112 }
113
114 const git_error *error = git_error_last();
115 if (error == NULL) /* Expected error - no error msg set */
116 return PyErr_Format(Error_type(err), "%s", str);
117
118 return PyErr_Format(Error_type(err), "%s: %s", str, error->message);
119}
120
121PyObject *
122Error_set_oid(int err, const git_oid *oid, size_t len)

Callers 11

discover_repositoryFunction · 0.85
init_file_backendFunction · 0.85
Error_set_oidFunction · 0.85
Repository_revparse_extFunction · 0.85
Repository_revparseFunction · 0.85
Repository_status_fileFunction · 0.85

Calls 1

Error_typeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…