mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit] Fail requests when an error occurs
Previously, requests would fail silently by returning an empty struct in the response. With this change, responses will properly report fail with the internal error.
This commit is contained in:
@@ -90,6 +90,8 @@ public:
|
||||
};
|
||||
|
||||
struct TestCursorInfo {
|
||||
// Empty if no error.
|
||||
std::string Error;
|
||||
std::string Name;
|
||||
std::string Typename;
|
||||
std::string Filename;
|
||||
@@ -146,7 +148,8 @@ public:
|
||||
|
||||
TestCursorInfo TestInfo;
|
||||
getLang().getCursorInfo(DocName, Offset, 0, false, false, Args,
|
||||
[&](const CursorInfoData &Info) {
|
||||
[&](const CursorInfoData &Info, StringRef Error) {
|
||||
TestInfo.Error = Error;
|
||||
TestInfo.Name = Info.Name;
|
||||
TestInfo.Typename = Info.TypeName;
|
||||
TestInfo.Filename = Info.Filename;
|
||||
|
||||
Reference in New Issue
Block a user