Exception: Sqlx::RecordNotFound

Inherits:
StandardError
  • Object
show all
Defined in:
runtime/sqlx/errors.rb,
runtime/sqlx/errors.rbs

Overview

Raised when a lookup finds no matching row. Sqlx::Base.find_by! and find raise it (message derived from table_name); apps also raise it directly for an absent record and rescue it to map the miss to an HTTP 404 at dispatch.

Instance Method Summary collapse

Constructor Details

#initialize(message = "Sqlx::RecordNotFound") ⇒ RecordNotFound

The default message is explicit so every build answers the same string.



15
# File 'runtime/sqlx/errors.rb', line 15

def initialize: (?String message) -> void