Skip to content
  • Ryuta Kamizono's avatar
    c196ca72
    Ensure `StatementCache#execute` never raises `RangeError` · c196ca72
    Ryuta Kamizono authored
    Since 31ffbf8d, finder methods no longer raise `RangeError`. So
    `StatementCache#execute` is the only place to raise the exception for
    finder queries.
    
    `StatementCache` is used for simple equality queries in the codebase.
    This means that if `StatementCache#execute` raises `RangeError`, the
    result could always be regarded as empty.
    So `StatementCache#execute` just return nil in that range error case,
    and treat that as empty in the caller side, then we can avoid catching
    the exception in much places.
    c196ca72
    Ensure `StatementCache#execute` never raises `RangeError`
    Ryuta Kamizono authored
    Since 31ffbf8d, finder methods no longer raise `RangeError`. So
    `StatementCache#execute` is the only place to raise the exception for
    finder queries.
    
    `StatementCache` is used for simple equality queries in the codebase.
    This means that if `StatementCache#execute` raises `RangeError`, the
    result could always be regarded as empty.
    So `StatementCache#execute` just return nil in that range error case,
    and treat that as empty in the caller side, then we can avoid catching
    the exception in much places.
Loading