It would help if you added some context around what you are actually trying to do? Is that a button on another object? Do you want to add that button to the Lead? Are you using approval processes?
no this is button on custom object and through this I want to convert lead. and if any probelm in converting lead then some other filed are there and error mesage should be populate in that field.
Gotcha. Then you could either create a checkbox on the Lead "Convert Lead" and a trigger that would convert the lead for you. This would allow you to have some more flexability, but might make your error handling a little more difficult to show on that page. Or you could create a LWC or VF Page that calls apex that would convert the lead using the link above.
I want to achieve this whole functionality through lightning component. but i am facing issue in achieving error. i have wriiten convert lead code but still i am facing issue.
But you can use this class (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_convertLead.htm) to convert a lead.