mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get more information from podofo exceptions
This commit is contained in:
parent
23766d6b83
commit
c84d019ef7
@ -9,10 +9,16 @@
|
|||||||
|
|
||||||
using namespace pdf;
|
using namespace pdf;
|
||||||
|
|
||||||
void pdf::podofo_set_exception(const PdfError &err) {
|
void
|
||||||
|
pdf::podofo_set_exception(const PdfError &err) {
|
||||||
const char *msg = PdfError::ErrorMessage(err.GetError());
|
const char *msg = PdfError::ErrorMessage(err.GetError());
|
||||||
if (msg == NULL) msg = err.what();
|
if (msg == NULL) msg = err.what();
|
||||||
PyErr_SetString(Error, msg);
|
std::stringstream stream;
|
||||||
|
stream << msg << "\n";
|
||||||
|
for (auto &info : err.GetCallstack()) {
|
||||||
|
stream << "File: " << info.GetFilename() << "Line: " << info.GetLine() << " " << info.GetInformation() << "\n";
|
||||||
|
}
|
||||||
|
PyErr_SetString(Error, stream.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *
|
PyObject *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user