mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Catch all exceptions when altering links
This commit is contained in:
parent
8d0f0cef93
commit
7f1519989f
@ -511,6 +511,12 @@ PDFDoc_alter_links(PDFDoc *self, PyObject *args) {
|
|||||||
} catch(const PdfError & err) {
|
} catch(const PdfError & err) {
|
||||||
podofo_set_exception(err);
|
podofo_set_exception(err);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
} catch(const std::exception & err) {
|
||||||
|
PyErr_Format(PyExc_ValueError, "An error occurred while trying to alter links: %s", err.what());
|
||||||
|
return NULL;
|
||||||
|
} catch (...) {
|
||||||
|
PyErr_SetString(PyExc_ValueError, "An unknown error occurred while trying to alter links");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
return Py_BuildValue("i", count);
|
return Py_BuildValue("i", count);
|
||||||
} // }}}
|
} // }}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user