@@ -136,10 +136,16 @@ zend_class_entry* phongo_exception_from_phongo_domain(php_phongo_error_domain_t
136136 MONGOC_ERROR ("Resolving unknown phongo error domain: %d" , domain );
137137 return php_phongo_runtimeexception_ce ;
138138}
139- zend_class_entry * phongo_exception_from_mongoc_domain (uint32_t /* mongoc_error_domain_t */ domain , uint32_t /* mongoc_error_code_t */ code )
139+ zend_class_entry * phongo_exception_from_mongoc_domain (mongoc_error_domain_t domain , mongoc_error_code_t code )
140140{
141- if (domain == MONGOC_ERROR_CLIENT && code == MONGOC_ERROR_CLIENT_AUTHENTICATE ) {
142- return php_phongo_authenticationexception_ce ;
141+ if (domain == MONGOC_ERROR_CLIENT ) {
142+ if (code == MONGOC_ERROR_CLIENT_AUTHENTICATE ) {
143+ return php_phongo_authenticationexception_ce ;
144+ }
145+
146+ if (code == MONGOC_ERROR_CLIENT_INVALID_ENCRYPTION_ARG ) {
147+ return php_phongo_invalidargumentexception_ce ;
148+ }
143149 }
144150
145151 if (domain == MONGOC_ERROR_COMMAND && code == MONGOC_ERROR_COMMAND_INVALID_ARG ) {
@@ -174,6 +180,10 @@ zend_class_entry* phongo_exception_from_mongoc_domain(uint32_t /* mongoc_error_d
174180 return php_phongo_connectionexception_ce ;
175181 }
176182
183+ if (domain == MONGOC_ERROR_CLIENT_SIDE_ENCRYPTION ) {
184+ return php_phongo_encryptionexception_ce ;
185+ }
186+
177187 return php_phongo_runtimeexception_ce ;
178188}
179189void phongo_throw_exception (php_phongo_error_domain_t domain TSRMLS_DC , const char * format , ...)
@@ -3728,6 +3738,7 @@ PHP_MINIT_FUNCTION(mongodb)
37283738 php_phongo_bulkwriteexception_init_ce (INIT_FUNC_ARGS_PASSTHRU );
37293739 php_phongo_commandexception_init_ce (INIT_FUNC_ARGS_PASSTHRU );
37303740 php_phongo_connectiontimeoutexception_init_ce (INIT_FUNC_ARGS_PASSTHRU );
3741+ php_phongo_encryptionexception_init_ce (INIT_FUNC_ARGS_PASSTHRU );
37313742 php_phongo_executiontimeoutexception_init_ce (INIT_FUNC_ARGS_PASSTHRU );
37323743 php_phongo_invalidargumentexception_init_ce (INIT_FUNC_ARGS_PASSTHRU );
37333744 php_phongo_logicexception_init_ce (INIT_FUNC_ARGS_PASSTHRU );
0 commit comments