class PgORM::Error::RecordNotFound

Overview

Raised when a record cannot be found in the database.

Example

User.find(999999)                              # Raises RecordNotFound
User.find!(999999)                             # Raises RecordNotFound
User.find_by(email: "[email protected]") # Raises RecordNotFound

Use the ? variants to return nil instead:

User.find?(999999)                              # => nil
User.find_by?(email: "[email protected]") # => nil

Defined in:

pg-orm/errors.cr

Instance methods inherited from class PgORM::Error

message : String? message

Constructor methods inherited from class PgORM::Error

new(message : String | Nil = "") new