Skip to content

Commit 5f0b2bc

Browse files
committed
Update decoding error message for HoverRequest to match others
1 parent 82be88f commit 5f0b2bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/LanguageServerProtocol/Hover.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ extension MarkedString: Codable {
7878
} else if let codeBlock = try? MarkdownCodeBlock(from: decoder) {
7979
self = .codeBlock(language: codeBlock.language, value: codeBlock.value)
8080
} else {
81-
let context = DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "MarkedString is neither pure string nor code block")
81+
let context = DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Expected String or MarkdownCodeBlock")
8282
throw DecodingError.dataCorrupted(context)
8383
}
8484
}
@@ -104,7 +104,7 @@ extension HoverResponseContents: Codable {
104104
} else if let value = try? MarkupContent(from: decoder) {
105105
self = .markupContent(value)
106106
} else {
107-
let context = DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "HoverResponseContents is neither MarkedString, nor [MarkedString], nor MarkupContent")
107+
let context = DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Expected MarkedString, [MarkedString], or MarkupContent")
108108
throw DecodingError.dataCorrupted(context)
109109
}
110110
}

0 commit comments

Comments
 (0)