static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
{
TSRMLS_FETCH();
- switch (type){
- case PDF_NonfatalError:
- /*
- * PDFlib warnings should be visible to the user.
- * If he decides to live with PDFlib warnings
- * he may use the PDFlib function
- * pdf_set_parameter($p, "warning" 0) to switch off
- * the warnings inside PDFlib.
- */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal PDFlib warning: %s", shortmsg);
- return;
- case PDF_MemoryError: /* give up in all other cases */
- case PDF_IOError:
- case PDF_RuntimeError:
- case PDF_IndexError:
- case PDF_TypeError:
- case PDF_DivisionByZero:
- case PDF_OverflowError:
- case PDF_SyntaxError:
- case PDF_ValueError:
- case PDF_SystemError:
- case PDF_UnknownError:
- default:
- php_error_docref(NULL TSRMLS_CC, E_ERROR,"PDFlib error: %s", shortmsg);
- }
+
+ if (type == PDF_NonfatalError) {
+ /*
+ * PDFlib warnings should be visible to the user.
+ * If he decides to live with PDFlib warnings
+ * he may use the PDFlib function
+ * pdf_set_parameter($p, "warning" 0) to switch off
+ * the warnings inside PDFlib.
+ */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal PDFlib warning: %s", shortmsg);
+ return;
+ } else {
+ /* give up in all other cases */
+ php_error_docref(NULL TSRMLS_CC, E_ERROR,"PDFlib error: %s", shortmsg);
+ }
}
/* }}} */