Well, two set of eyes are better than one. I gave this program to my colleague to use as a template for his process. He asked me why in the catch block I have
catch to loErr
.CustomError(m.loErr)
endtry
I didn't notice that somehow I missed lcError = .CustomError(m.loErr)
That's why my procedure could not properly report the error and was returning this confusing message.
>Hi everybody,
>
>I was using this syntaxt in one of my procedure:
>lcBatch_Processes_Fk = Get_Batch_Processes_Fk_By_Process_Name(.cBatchProcessName)
>
>This is the error I was getting that took me few days to understand what's really going on:
>
>* Batch Services (T:\IT_Testing )Errors (CLOSE APPLICATION):
>Message : customerror
>__ri_handler("INSERT")
> Line : 2027
> Error :
>Operator/operand type mismatch.
>
>
>I added couple of log messages to my procedure (since I tested it outside Batch Service application and it worked fine) and finally realized that that function was in VisCollect_Cursors program which is not part of the Batch Service. So, the resolution is quite simple - move it to Common_Utility, which is shared between two applications.
>
>But why the error message was about Type mismatch instead of function not found?
>
>Thanks.
If it's not broken, fix it until it is.
My Blog