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
Hemant Gulati 4Hemant Gulati 4 

Getting internal server error issue in lightning app

I am getting this issue "An internal server error has occurred Error ID: 1854847182-41225 (-1177185898)" while inserting a record through lightninig app, as i am calling a Component function from helper file and passing an object(record) in it.

Helper file code:-  

createExpense: function(component, expense) {
        this.upsertExpense(component, expense, function(a) {
            var expenses = component.get("v.expenses");
            component.set("v.expenses", expenses);
    upsertExpense : function(component, expense, callback) {
        var action = component.get("c.saveExpense",expense);
            "expense": expense
        if (callback) {
            action.setCallback(this, callback);

Controller file code:- 

public with sharing class ExpenseController {
    public static Expense__c saveExpense(Expense__c expense) {
        // Perform isUpdateable() check here
        System.debug('Upsert Start');
        upsert expense;
        System.debug('Upsert Done');
        return expense;
    public static List<Expense__c> getExpenses() {
        // Perform isAccessible() check here
        return [SELECT Id, Name, Amount__c, Client__c, Date__c,
                Reimbursed__c, CreatedDate FROM Expense__c];

getExpenses function is running correctly, but when i am calling saveExpense from helper file, it generates error.

Please help me.

Hemant Gulati