Simplify a bit

This commit is contained in:
foobar 2003-08-11 02:32:17 +00:00
parent 7f5dc67bb0
commit da30777de5

View File

@ -254,31 +254,21 @@ static void _free_pdf_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
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);
}
}
/* }}} */