From 122d759618a42bff105971b923fbbb5be02e34b9 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 2 Apr 2015 18:52:32 +0200 Subject: Always throw TypeException on throwing zpp failures Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to report FAILURE errors using a TypeException instead of a Warning, like it would happen in strict mode. Adds a zend_parse_parameters_throw() convenience function, which invokes zpp with this flag. Converts all cases I could identify, where we currently have throwing zpp usage in constructors and replaces them with this API. Error handling is still replaced to EH_THROW in some cases to handle other, domain-specific errors in constructors. --- ext/intl/intl_error.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/intl/intl_error.c') diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c index a946705a76..adbdd5afb8 100644 --- a/ext/intl/intl_error.c +++ b/ext/intl/intl_error.c @@ -101,7 +101,7 @@ void intl_error_reset( intl_error* err ) /* {{{ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg ) * Set last error message to msg copying it if needed. */ -void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg ) +void intl_error_set_custom_msg( intl_error* err, const char* msg, int copyMsg ) { if( !msg ) return; @@ -122,7 +122,7 @@ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg ) err->free_custom_error_message = copyMsg; /* Set user's error text message */ - err->custom_error_message = copyMsg ? estrdup( msg ) : msg; + err->custom_error_message = copyMsg ? estrdup( msg ) : (char *) msg; } /* }}} */ @@ -180,7 +180,7 @@ UErrorCode intl_error_get_code( intl_error* err ) /* {{{ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) * Set error code and message. */ -void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) +void intl_error_set( intl_error* err, UErrorCode code, const char* msg, int copyMsg ) { intl_error_set_code( err, code ); intl_error_set_custom_msg( err, msg, copyMsg ); @@ -190,7 +190,7 @@ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) /* {{{ void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) * Set error code and message. */ -void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg ) +void intl_errors_set( intl_error* err, UErrorCode code, const char* msg, int copyMsg ) { intl_errors_set_code( err, code ); intl_errors_set_custom_msg( err, msg, copyMsg ); @@ -210,7 +210,7 @@ void intl_errors_reset( intl_error* err ) /* {{{ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg ) */ -void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg ) +void intl_errors_set_custom_msg( intl_error* err, const char* msg, int copyMsg ) { if(err) { intl_error_set_custom_msg( err, msg, copyMsg ); -- cgit v1.2.1