ITADN

Expose structured fields (code, title, trace) in CompileError

#573Closednyx0 创建于 2026-02-24
N
nyx0commented
When compiling a YARA rule with yara-x==1.13.0 that uses the vt module, I receive the following error: ``` yara_x.CompileError error[E100]: vt.metadata is supported only in rulesets matching against files --> line:13:13 | 13 | vt.metadata.analysis_stats.malicious > 0 or | ^^^^^^^^ this field is supported for files only ``` Right now, the error information appears to be available only as a formatted string. It would be very helpful if `CompileError` exposed structured attributes for easier error handling. Expected behavior: code = `E100` title = `vt.metadata is supported only in rulesets matching against files` trace = the formatted trace block: ``` --> line:13:13 | 13 | vt.metadata.analysis_stats.malicious > 0 or | ^^^^^^^^ this field is supported for files only ```
关闭于 2026-02-24 1 条评论