]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7269 : Add error logs in exec_user_method() when exception occurs.
authorVineet Chaudhary <code.vineet@gmail.com>
Thu, 12 Feb 2015 13:11:12 +0000 (18:41 +0530)
committerVineet Chaudhary <code.vineet@gmail.com>
Thu, 12 Feb 2015 13:11:12 +0000 (18:41 +0530)
In exec_user_method() report ERROR LOG to console in cases exceptions occurs,
like if any of class/method/userMethod->arg is null or for any reason which
sets status to SWITCH_STATUS_FALSE because that prevents loading mod_java and
users don't have clue why it is failing to load.

With this patch error logs can tell why method failed to execute.

src/mod/languages/mod_java/modjava.c

index 17b72d582681a1ced5cd0abc6a1b1f7b4992152e..811237d5fdd1ecdf27a5149ab13f2dc26daf657c 100644 (file)
@@ -128,6 +128,7 @@ static switch_status_t exec_user_method(user_method_t * userMethod) {
 
     if (class == NULL) {
         (*env)->ExceptionDescribe(env);
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Class not found\n",userMethod->class);
         status =  SWITCH_STATUS_FALSE;
         goto done;
     }
@@ -136,6 +137,7 @@ static switch_status_t exec_user_method(user_method_t * userMethod) {
 
     if (method == NULL) {
         (*env)->ExceptionDescribe(env);
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Method not found\n",userMethod->method);
         status =  SWITCH_STATUS_FALSE;
         goto done;
     }
@@ -145,6 +147,7 @@ static switch_status_t exec_user_method(user_method_t * userMethod) {
 
         if (arg == NULL) {
             (*env)->ExceptionDescribe(env);
+            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Args not found\n");
             status =  SWITCH_STATUS_FALSE;
             goto done;
         }