@@ -507,7 +507,8 @@ PHP_FUNCTION(enchant_broker_request_dict)
507
507
dict -> pdict = pdict ;
508
508
ZVAL_COPY (& dict -> zbroker , broker );
509
509
} else if (getThis ()) {
510
- zend_throw_exception (spl_ce_RuntimeException , "Can't create a new EnchantDict" , 0 );
510
+ const char * err = enchant_broker_get_error (pbroker -> pbroker );
511
+ zend_throw_exception_ex (spl_ce_RuntimeException , 0 , "%s" , err ? err : "Can't create a new EnchantDict" );
511
512
} else {
512
513
RETURN_FALSE ;
513
514
}
@@ -552,7 +553,8 @@ PHP_METHOD(EnchantDict, __construct)
552
553
dict -> pdict = pdict ;
553
554
ZVAL_COPY (& dict -> zbroker , broker );
554
555
} else {
555
- zend_throw_exception (spl_ce_RuntimeException , "Can't create a new EnchantDict" , 0 );
556
+ const char * err = enchant_broker_get_error (pbroker -> pbroker );
557
+ zend_throw_exception_ex (spl_ce_RuntimeException , 0 , "%s" , err ? err : "Can't create a new EnchantDict" );
556
558
}
557
559
}
558
560
/* }}} */
@@ -587,7 +589,8 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
587
589
dict -> pdict = pdict ;
588
590
ZVAL_COPY (& dict -> zbroker , broker );
589
591
} else if (getThis ()) {
590
- zend_throw_exception (spl_ce_RuntimeException , "Can't create a new EnchantDict" , 0 );
592
+ const char * err = enchant_broker_get_error (pbroker -> pbroker );
593
+ zend_throw_exception_ex (spl_ce_RuntimeException , 0 , "%s" , err ? err : "Can't create a new EnchantDict" );
591
594
} else {
592
595
RETURN_FALSE ;
593
596
}
0 commit comments