Skip to content

Commit 6b55cbd

Browse files
Copilotwannaphong
andcommitted
Improve error message for dictionary loading failure
Co-authored-by: wannaphong <8536487+wannaphong@users.noreply.github.com>
1 parent 2e84090 commit 6b55cbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/cthainlp_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static PyObject* py_newmm_segment(PyObject* Py_UNUSED(self), PyObject* args, PyO
8282
/* Get or load dictionary */
8383
newmm_dict_t dict = get_or_load_dict(dict_path);
8484
if (!dict) {
85-
PyErr_SetString(PyExc_RuntimeError, "Failed to load dictionary");
85+
PyErr_SetString(PyExc_MemoryError, "Failed to load dictionary (out of memory)");
8686
return NULL;
8787
}
8888

0 commit comments

Comments
 (0)