I am tried calling below @AuraEnabled method from a lightning component.
@AuraEnabled
public static ConnectApi.FeedElementPage getFeedElementsOfType(String feedType, Integer pageSize, String pageToken, String sortParam,String subjectId) {
feedType = feedType != null
? feedType
: 'UserProfile';
pageSize = pageSize != null
? pageSize
: 10;
pageToken = String.isNotBlank(pageToken)
? pageToken
: null;
sortParam = String.isNotBlank(sortParam)
? sortParam
: null;
subjectId = subjectId != null
? subjectId
: 'me';
return ChatterUtils.getFeedElements(feedType, subjectId, pageSize, pageToken, sortParam);
}
This was giving me error as below in callback function of lightning component helper method.
An internal server error has occurred Error ID: 1483360533-7490 (1005877919)
org.auraframework.throwable.AuraExecutionException: apex://ChatterFeedController: java.lang.IllegalArgumentException: java.lang.ClassCastException@7c7b83dc
But same code was running fine if I replace
pageSize = pageSize != null
? pageSize
: 10;
with
pageSize = pageSize != null
? Integer.valueOf(pageSize)
: 10;
This seems to be a strange issue. Does anyone have any idea about this behavior ?