<commit_before>require_dependency "pancakes/application_controller"

module Pancakes
  class RecordsController < ApplicationController
    def create
      attributes = table.insert(params[:record])
      @record = Pancakes::Record.new(attributes)
    rescue PG::Error
      render status: 500
    end

    def update
      attributes = table.update(params[:id], params[:attributes])
      @record = Pancakes::Record.new(attributes.to_a.first)
    rescue PG::Error
      render status: 500
    end
<commit_msg>rescue should respond with an error in RecordsController.<commit_after>require_dependency "pancakes/application_controller"

module Pancakes
  class RecordsController < ApplicationController
    def create
      attributes = table.insert(params[:record])
      @record = Pancakes::Record.new(attributes)
    rescue PG::Error => e
      render status: 500
    end

    def update
      attributes = table.update(params[:id], params[:attributes])
      @record = Pancakes::Record.new(attributes.to_a.first)
    rescue PG::Error => e
      render status: 500
    end

{'fraction_non_alphanumeric': 0.09217877094972067, 'fraction_numerical': 0.0111731843575419, 'mean_word_length': 3.6943231441048034, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1463756', 'n_tokens_mistral': 304, 'n_tokens_neox': 285, 'n_words': 73}