11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/lldb/native.rb', line 11
def self.check_status!(status, operation, error = nil)
return true if status == NativeStatus::OK
if status == NativeStatus::INTERNAL_ERROR
message = FFIBindings.lldb_wrapper_last_error_message || 'unknown native exception'
code = FFIBindings.lldb_wrapper_last_error_code
raise InternalBindingError.new(operation, message, code)
end
native_error = error || Error.new
unless native_error.fail?
native_error.set_error("native operation failed with status #{status}")
end
raise OperationError.new(operation, native_error)
end
|