From 3e4697bc3879f9e28602c4efaeb105ed3c04e6c6 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 4 Aug 2023 08:19:18 +0200 Subject: [PATCH] PHPC-1000: Add missing exception --- src/phongo_bson_encode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/phongo_bson_encode.c b/src/phongo_bson_encode.c index 7780e877d..02c6f0f89 100644 --- a/src/phongo_bson_encode.c +++ b/src/phongo_bson_encode.c @@ -130,6 +130,10 @@ static inline bool phongo_check_bson_serialize_return_type(zval* retval, zend_cl return true; } + phongo_throw_exception(PHONGO_ERROR_UNEXPECTED_VALUE, + "Expected to receive instance of %s, %s given", + ZSTR_VAL(php_phongo_serializable_ce->name), + ZSTR_VAL(ce->name)); return false; }