Răsfoiți Sursa

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

Daniel-Constantin Mierla 3 ani în urmă
părinte
comite
8c910452cf
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 5 0
      src/modules/app_perl/perlfunc.c

+ 5 - 0
src/modules/app_perl/perlfunc.c

@@ -147,6 +147,11 @@ int perl_exec2(struct sip_msg* _msg, char* fnc, char* mystr) {
 	PUTBACK;			/* make local stack pointer global */
 
 	call_pv(fnc, G_EVAL|G_SCALAR);		/* call the function     */
+
+	if(SvTRUE(ERRSV)) {
+		LM_WARN("perl error: %s\n", SvPV_nolen(ERRSV));
+	}
+
 	SPAGAIN;			/* refresh stack pointer         */
 	/* pop the return value from stack */
 	retval = POPi;