mirror of
https://github.com/latex-lsp/texlab.git
synced 2025-12-23 09:19:21 +00:00
Add failure case to ForwardSearchStatus
This commit is contained in:
parent
65f3a3ecc2
commit
4bf1997296
2 changed files with 9 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ package texlab.search
|
|||
enum class ForwardSearchStatus(val value: Int) {
|
||||
SUCCESS(0),
|
||||
ERROR(1),
|
||||
UNCONFIGURED(2);
|
||||
FAILURE(2),
|
||||
UNCONFIGURED(3);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,14 @@ object ForwardSearchTool {
|
|||
.redirectOutput(ProcessBuilder.Redirect.PIPE)
|
||||
.redirectError(ProcessBuilder.Redirect.PIPE)
|
||||
.start()
|
||||
process.waitFor()
|
||||
ForwardSearchStatus.SUCCESS
|
||||
val exitCode = process.waitFor()
|
||||
if (exitCode == 0) {
|
||||
ForwardSearchStatus.SUCCESS
|
||||
} else {
|
||||
ForwardSearchStatus.ERROR
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
ForwardSearchStatus.ERROR
|
||||
ForwardSearchStatus.FAILURE
|
||||
}
|
||||
return ForwardSearchResult(status)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue