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
sridhar sivaramansridhar sivaraman 

An internal server error has occurred Error ID: 1544293028-3109 (-1865483868)

While doing the super badge  "Lightning Component Framework Specialist" I get the Internal Server error.

here is the code snippet.

BoatSearchResults.apxc
public with sharing class BoatSearchResults {
 @AuraEnabled
    public static List<Boat__c> getBoats(String boatTypeID) {
        System.debug('BoatSearch Results : ' + boatTypeID);
        List<Boat__c> returnList;
            if (boatTypeID != ''){
                returnList = [Select ID, Name, BoatType__c, contact__r.Name, Geolocation__c, Picture__c from Boat__c
                       where BoatType__c =:boatTypeID];
            } else {
                returnList = [Select ID, Name, BoatType__c, contact__r.Name, Geolocation__c, Picture__c from Boat__c];
            }
        System.debug('BoatSearch Results Return Count: ' + returnList.size());
        return returnList;
    }
}

BoatSearchResultHelper.js
({
 onSearch : function(component) {
        // Create the action
        var boatTypeID = component.get('v.selectedBoatID'); 
  console.log('In onSearch function: ' + boatTypeID);
        var action = component.get("c.getBoats");
        action.setParams({boatTypeID : boatTypeID});
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
   console.log('In onSearch function state: ' + state);
            if (state === "SUCCESS") {
                component.set("v.boats", response.getReturnValue());
            }
            else {
          console.log('In onSearch function Failed: ' + response);
                console.info('RESPONSE', response);
               var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("***Error message: " +
                                 errors[0].message);
                    }
                 } else {
                    console.log("***Unknown error");
                }
                console.log("Failed with state: " + state); 
            }
        });
       
        // Send action off to be executed
        $A.enqueueAction(action);
 }
})

BoatSearchResultsHelper.js
({
 onSearch : function(component) {
        // Create the action
        var boatTypeID = component.get('v.selectedBoatID'); 
  console.log('In onSearch function: ' + boatTypeID);
        var action = component.get("c.getBoats");
        action.setParams({boatTypeID : boatTypeID});
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
   console.log('In onSearch function state: ' + state);
            if (state === "SUCCESS") {
                component.set("v.boats", response.getReturnValue());
            }
            else {
          console.log('In onSearch function Failed: ' + response);
                console.info('RESPONSE', response);
               var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("***Error message: " +
                                 errors[0].message);
                    }
                 } else {
                    console.log("***Unknown error");
                }
                console.log("Failed with state: " + state); 
            }
        });
       
        // Send action off to be executed
        $A.enqueueAction(action);
 }
})

BoatSearchResults.cmp
<aura:component implements="flexipage:availableForAllPageTypes" controller="BoatSearchResults">
    <aura:handler name="boatSelect" event="c:BoatSelect" action="{!c.handleBoatSelect}"/>
   
    <aura:method name="search"
      description="Method to search all boats related to boat type">
        <aura:attribute name="boatTypeId" type="String" />
    </aura:method>
   
   
    <aura:attribute name="selectedBoatID" type="String"/>
    <aura:attribute name="boats" type="Boat__c[]" default="[]"/>
   
 <lightning:layout horizontalAlign="space" multipleRows="true">
        <aura:if isTrue="{!not(empty(v.boats))}">
            <!--Iterate the mapEntry Component.-->
            <aura:iteration items="{!v.boats}" var="boat" >
                <lightning:layoutItem flexibility="auto" size="12" mediumDeviceSize="6" largeDeviceSize="3" padding="around-small">
                 <c:BoatTile boat="{!boat}" selected="false"/>
                </lightning:layoutItem>
            </aura:iteration>
            <aura:set attribute="else">
                <div class="slds-align_absolute-center" style="text-align:center;"> No boats found </div>
            </aura:set>
        </aura:if>>
    </lightning:layout>
</aura:component>

Strangely  I did clear the step 4 “Implement the search filter” even with this error. However I want this to be resolved so that I can go ahead with other steps.

Any help will be appreciated .
Best Answer chosen by sridhar sivaraman
sridhar sivaramansridhar sivaraman
This got resolved.
Visit the URL if you are intereseted few discussion about it.
https://salesforce.stackexchange.com/questions/201440/lightning-an-internal-server-error-has-occurred-error-id-1544293028-3109-18