Exception: R2CORBA::CORBA::UserException
- Inherits:
-
Exception
- Object
- StandardError
- Exception
- R2CORBA::CORBA::UserException
show all
- Defined in:
- lib/corba/jbase/exception.rb,
lib/corba/common/exception.rb
Class Method Summary
collapse
Methods inherited from Exception
native2r
Class Method Details
._raise(jex) ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/corba/jbase/exception.rb', line 34
def self._raise(jex)
STDERR.puts "#{jex}\n#{jex.backtrace.join("\n")}" if $VERBOSE and (NativeException === jex)
if (NativeException === jex and jex.cause.is_a?(Native::UnknownUserException)) or jex.is_a?(Native::UnknownUserException)
java_ex = jex.is_a?(Native::UnknownUserException) ? jex : jex.cause
ex = Any.from_java(java_ex.except)
ex.set_backtrace(jex.backtrace) if NativeException === jex
raise ex
elsif (NativeException === jex and jex.cause.is_a?(Native::UserException)) or jex.is_a?(Native::UserException)
java_ex = jex.is_a?(Native::UserException) ? jex : jex.cause
exname = java_ex.class.name.split('::').last
tcs = CORBA::TypeCode.typecodes_for_name(exname) || []
extc = tcs.detect {|tc| tc.is_a?(TypeCode::Except) && tc.is_compatible?(java_ex)}
if extc
ex = extc.from_java(java_ex)
ex.set_backtrace(jex.backtrace) if NativeException === jex
raise ex
end
end
raise CORBA::UNKNOWN.new("#{jex}", 0, CORBA::COMPLETED_MAYBE)
end
|