Invoke code: Exception has been thrown by the target of an invocation using invoke code

Hello guys please help me how to solve above error when i using invoke code and write a code for delete file from directory.

Regards and Thanks
Zaid Qazi

@zaid.ahmad ,
I guess the error is missing, can you please share the error??

Hi @zaid.ahmad ,

Could you we get more details of the Code Snippet used in Invoke Code Activity ?

Also make sure you are encapsulating the Code within a Try Catch and use a Write Line or Log the exception message or direct the exception to an out argument such that we can handle the Exception in a better way.

Based on the Exception message we can understand the issue being faced.

@zaid.ahmad ,
the error is because the argument doesnt have proper value or it is null. Give a break point in the invoke activity and check in immediate panel whether all the values passing have values

hello @muhamed_fasil
please see the title

HI,

Can you share content of $exceptionDetails at Locals panel when exception occurs in debug mode? There will be more detailed information for the exception.

Regards,

Hello @supermanPunch Thanks for this
Actually i was using another argument on this invoke code activity but right now its running

hello @Yoichi
this error i solved it but in same process when i get the file from directory and then i have got this error “Type Into ‘Edit’: Special keys syntax error. Encountered invalid special key action at text position: 15.”
what it means?

Hi,

I guess your input text contains [ character. If so, can you try to escape it like [[ ? Or try to change input mode to Simulate type.

Regards,

@Yoichi thanks for this
its proper working

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.