class Lato::ApplicationController

def respond_to_with_error(exception = nil)

def respond_to_with_error(exception = nil)
  @exception = Rails.env.production? ? nil : exception
  hide_sidebar
  respond_to do |format|
    format.html { render 'lato/errors/error', status: :internal_server_error }
    format.json { render json: { error: @exception&.message || 'Internal server error' }, status: :internal_server_error }
  end
end