Skip to content

Commit

Permalink
Improve error messaging for interceptor failures
Browse files Browse the repository at this point in the history
Enhance the error handling by providing detailed context in failure messages of the interceptor calls. Error reports now include both the class and method names where the failure occurred, aiding in quicker diagnostics and debugging.
  • Loading branch information
koriym committed Dec 9, 2024
1 parent 458c2d8 commit dccadcb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rayaop.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,12 @@ static void rayaop_execute_ex(zend_execute_data *execute_data) {
}
}
} else if (call_result != SUCCESS) {
php_rayaop_handle_error(RAYAOP_E_INVALID_HANDLER, "Interceptor call failed");
char error_msg[256];
snprintf(error_msg, sizeof(error_msg),
"Interceptor call failed for %s::%s",
ZSTR_VAL(info->class_name),
ZSTR_VAL(info->method_name));
php_rayaop_handle_error(RAYAOP_E_INVALID_HANDLER, error_msg);
}

cleanup:
Expand Down

0 comments on commit dccadcb

Please sign in to comment.