Skip to content

[codespaces] vscode extension crashes if specified log output location doesn't work #676

Closed
@martinlippert

Description

@martinlippert

I am running a Codespaces workspace from my local VSCode install and the Spring Boot extension crashes with this:

Redirecting log output to: /Users/mlippert/Desktop/vscode-logs.txt
Exception in thread "main" java.io.FileNotFoundException: /Users/mlippert/Desktop/vscode-logs.txt (No such file or directory)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at org.springframework.ide.vscode.commons.util.LogRedirect.logFileStream(LogRedirect.java:38)
	at org.springframework.ide.vscode.commons.util.LogRedirect.bootRedirectToFile(LogRedirect.java:24)
	at org.springframework.ide.vscode.boot.app.BootLanguageServerBootApp.main(BootLanguageServerBootApp.java:103)
[Info  - 10:27:27 AM] Connection to server got closed. Server will restart.

The reason seems to be that my local preferences contain this setting:

"spring-boot.ls.logfile": "/Users/mlippert/Desktop/vscode-logs.txt"

But this path is obviously not valid inside of a Codespaces workspace. So instead of crashing the extension we need to check if this path exists and if not, send back an error message without crashing the whole extension.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions