Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 180329

How to show custom error message if Custom takes has error using VIJAVA api

$
0
0

Hi ,

 

           I trying to create the custom task and in case of error I would like to show the custom error message on vsphere client.

 

         My code to show the error message as below :

                    LocalizedMethodFault lmf = new LocalizedMethodFault();

                    lmf.setLocalizedMessage("My Error Message");

                    task.setTaskState(TaskInfoState.error, null, lmf);

 

         Using the above code I am not able to see the custom error message "My Error Message" on the vsphere client and it gives the error saying "com.vmware.vim25.InvalidRequest".

 

         Please provide the sample code that will show the custom message on the vsphere client.

 

    Thanks & Regards


Viewing all articles
Browse latest Browse all 180329

Trending Articles