Exception: QueryStream::DataLoadError
- Defined in:
- lib/query_stream/errors.rb
Overview
データファイルの読み込みに失敗した(YAML/JSON 構文エラー、YAML で許可されていないクラス/タグ等)
セキュリティ設計:
YAML データファイルは `YAML.safe_load_file` で読み込まれ、
`!ruby/object` など危険な Ruby オブジェクトタグは
`Psych::DisallowedClass` として検出され、本例外に変換される。
Instance Attribute Summary collapse
-
#cause_error ⇒ StandardError?
readonly
元の例外(Psych::DisallowedClass 等).
-
#file_path ⇒ String
readonly
読み込みに失敗したファイルパス.
Instance Method Summary collapse
-
#initialize(msg = nil, file_path: nil, cause_error: nil) ⇒ DataLoadError
constructor
A new instance of DataLoadError.
Constructor Details
#initialize(msg = nil, file_path: nil, cause_error: nil) ⇒ DataLoadError
Returns a new instance of DataLoadError.
70 71 72 73 74 |
# File 'lib/query_stream/errors.rb', line 70 def initialize(msg = nil, file_path: nil, cause_error: nil) super(msg || "データファイルの読み込みに失敗しました: #{file_path}") @file_path = file_path @cause_error = cause_error end |
Instance Attribute Details
#cause_error ⇒ StandardError? (readonly)
元の例外(Psych::DisallowedClass 等)
67 68 69 |
# File 'lib/query_stream/errors.rb', line 67 def cause_error @cause_error end |
#file_path ⇒ String (readonly)
読み込みに失敗したファイルパス
67 68 69 |
# File 'lib/query_stream/errors.rb', line 67 def file_path @file_path end |