Exception: RatatuiRuby::Error::Safety
- Inherits:
-
RatatuiRuby::Error
- Object
- StandardError
- RatatuiRuby::Error
- RatatuiRuby::Error::Safety
- Defined in:
- lib/ratatui_ruby.rb
Overview
Object lifetime violation.
Some objects are only valid during specific scopes. Using them after their scope ends causes undefined behavior.
This error prevents use-after-scope bugs. The object you’re accessing is no longer valid.
To resolve, ensure scoped objects are used only within their valid lifetime (e.g., inside the block where they’re created).
Example
– SPDX-SnippetBegin SPDX-FileCopyrightText: 2026 Kerrick Long SPDX-License-Identifier: MIT-0 ++
stored_frame = nil
RatatuiRuby.draw { |frame| stored_frame = frame }
stored_frame.area # => raises Error::Safety
– SPDX-SnippetEnd ++