Commit e751fe67

e751fe677c60Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 2 files · ~2 modified

Description

Catchable RegexpError and StringScanner::Error

  • sp_re_init installs sp_re_default_error_handler after static-literal pre-compile, so a runtime Regexp.new(bad) raises a catchable RegexpError instead of aborting the process.
  • StringScanner_Error / FiberError registered as StandardError subclasses and recognized by is_exc_name; a rescue of a builtin namespaced exception (StringScanner::Error) maps to its flattened runtime class name, gated so user M::Err classes keep leaf matching.

Fixes regexp_error_catchable and string_scanner_unscan_error.

Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]

Details

Commit
e751fe677c60
Parent
436dc8f881dc

lib/sp_runtime.hmodifiedView file

@@ -4478,6 +4478,8 @@
44784478 {"EncodingError", "StandardError"},
44794479 {"LoadError", "StandardError"},
44804480 {"RegexpError", "StandardError"},
4481+ {"StringScanner_Error", "StandardError"},
4482+ {"FiberError", "StandardError"},
44814483 {"SyntaxError", "ScriptError"},
44824484 {"ScriptError", "Exception"},
44834485 {"StandardError", "Exception"},
@@ -4534,6 +4536,8 @@
45344536 {"EncodingError", "StandardError"},
45354537 {"LoadError", "StandardError"},
45364538 {"RegexpError", "StandardError"},
4539+ {"StringScanner_Error", "StandardError"},
4540+ {"FiberError", "StandardError"},
45374541 {"SyntaxError", "ScriptError"},
45384542 {"ScriptError", "Exception"},
45394543 {"StandardError", "Exception"},