function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nitish Singh 22Nitish Singh 22 

Exception handling for Dynamic SOSL

I have the following code :

String SOSL = 'FIND { "How can I pay my invoice?"} IN ALL FIELDS RETURNING WKArticleType__kav(Id,Title, CreatedDate, LastModifiedDate, Details__c, UrlName,Topic__C, Input_Method__c WHERE PublishStatus='Online' AND language ='en_US'offset 0)
try{
List<List<SObject>> genArticles =  search.query(sosl) ;
}
 catch(QueryException ex){
          system.debug('Unable to fetch KB Article for the given facets'+ ex.getMessage());   
        }

I am having an exception of type  System.UnexpectedException .The execution never goes to catch block.

Any suggestion would be appreciated