Skip to content

Commit 0d77368

Browse files
committed
[lldb] Adapt error handling API in ReflectionContext.
1 parent f2bf1e4 commit 0d77368

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/ReflectionContext.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ class TargetReflectionContext : public ReflectionContextInterface {
180180
auto *rti =
181181
m_type_converter.getClassInstanceTypeInfo(&type_ref, *start, provider);
182182
if (!rti)
183-
return llvm::createStringError(
184-
"converter returned nullptr typeinfo but no error");
183+
return llvm::createStringError(m_type_converter.getLastError());
185184
return *rti;
186185
}
187186

@@ -201,14 +200,12 @@ class TargetReflectionContext : public ReflectionContextInterface {
201200
provider ? provider->getId() : 0, ss.str());
202201
}
203202

204-
auto type_info = m_reflection_ctx.getTypeInfo(&type_ref, provider);
205-
if (!type_info) {
206-
std::stringstream ss;
207-
ss << "Could not find type info for ";
208-
type_ref.dump(ss);
209-
ss << " in reflection metadata";
210-
return llvm::createStringError(ss.str());
211-
}
203+
auto type_info = m_reflection_ctx.getTypeInfo(type_ref, provider);
204+
if (!type_info)
205+
return llvm::joinErrors(
206+
llvm::createStringError(
207+
"Could not find reflection metadata for type"),
208+
type_info.takeError());
212209

213210
if (log && log->GetVerbose()) {
214211
std::stringstream ss;

0 commit comments

Comments
 (0)