Browse code

app_perl: print the error string if execution of perl script sets it

Daniel-Constantin Mierla authored on 08/07/2022 11:19:14
Showing 1 changed files
... ...
@@ -147,6 +147,11 @@ int perl_exec2(struct sip_msg* _msg, char* fnc, char* mystr) {
147 147
 	PUTBACK;			/* make local stack pointer global */
148 148
 
149 149
 	call_pv(fnc, G_EVAL|G_SCALAR);		/* call the function     */
150
+
151
+	if(SvTRUE(ERRSV)) {
152
+		LM_WARN("perl error: %s\n", SvPV_nolen(ERRSV));
153
+	}
154
+
150 155
 	SPAGAIN;			/* refresh stack pointer         */
151 156
 	/* pop the return value from stack */
152 157
 	retval = POPi;