diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-12-31 17:07:42 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-01-28 15:25:35 +0000 |
commit | 8af4ef30e57759d4f3994a56dbb38a6151f0bbd3 (patch) | |
tree | 512c4beede92e3a010583636e1dd6d46a5c832a0 /ext/win32ole | |
parent | 1e2d088dd3d534958c4e010a6bcb815cce83c1b5 (diff) |
[ruby/win32ole] Move `WIN32OLE` prefixed error classes under `WIN32OLE`
https://github.com/ruby/win32ole/commit/1c95816168
Diffstat (limited to 'ext/win32ole')
-rw-r--r-- | ext/win32ole/lib/win32ole.rb | 2 | ||||
-rw-r--r-- | ext/win32ole/win32ole_error.c | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/ext/win32ole/lib/win32ole.rb b/ext/win32ole/lib/win32ole.rb index 5e20f104cd..f5c8a52c4a 100644 --- a/ext/win32ole/lib/win32ole.rb +++ b/ext/win32ole/lib/win32ole.rb @@ -25,7 +25,7 @@ if defined?(WIN32OLE) def ole_methods_safely ole_methods - rescue WIN32OLEQueryInterfaceError + rescue WIN32OLE::QueryInterfaceError [] end end diff --git a/ext/win32ole/win32ole_error.c b/ext/win32ole/win32ole_error.c index 2bb5156263..66b5136dee 100644 --- a/ext/win32ole/win32ole_error.c +++ b/ext/win32ole/win32ole_error.c @@ -67,7 +67,7 @@ void Init_win32ole_error(void) { /* - * Document-class: WIN32OLERuntimeError + * Document-class: WIN32OLE::RuntimeError * * Raised when OLE processing failed. * @@ -77,11 +77,20 @@ Init_win32ole_error(void) * * raises the exception: * - * WIN32OLERuntimeError: unknown OLE server: `NonExistProgID' + * WIN32OLE::RuntimeError: unknown OLE server: `NonExistProgID' * HRESULT error code:0x800401f3 * Invalid class string * */ - eWIN32OLERuntimeError = rb_define_class("WIN32OLERuntimeError", rb_eRuntimeError); - eWIN32OLEQueryInterfaceError = rb_define_class("WIN32OLEQueryInterfaceError", eWIN32OLERuntimeError); + eWIN32OLERuntimeError = rb_define_class_under(cWIN32OLE, "RuntimeError", rb_eRuntimeError); + /* Alias of WIN32OLE::RuntimeError, for the backward compatibility */ + rb_define_const(rb_cObject, "WIN32OLERuntimeError", eWIN32OLERuntimeError); + /* + * Document-class: WIN32OLE::QueryInterfaceError + * + * Raised when OLE query failed. + */ + eWIN32OLEQueryInterfaceError = rb_define_class_under(cWIN32OLE, "QueryInterfaceError", eWIN32OLERuntimeError); + /* Alias of WIN32OLE::QueryInterfaceError, for the backward compatibility */ + rb_define_const(rb_cObject, "WIN32OLEQueryInterfaceError", eWIN32OLEQueryInterfaceError); } |