File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,8 @@ class GenerateTreeCommand(
3636
3737 private fun getProjectPath (rootPath : String , relativePath : String? ): String {
3838 val fileName = " project.godot"
39- val path = Paths .get(rootPath, relativePath ? : " " , fileName).toString()
40- if (! File (path).exists()) throw InvalidGodotProject ()
41- return path
39+ val path = Paths .get(rootPath, relativePath ? : " " , fileName)
40+ return path.toString()
4241 }
4342
4443 private fun getOutputPath (rootPath : String , packageName : String? ): String {
Original file line number Diff line number Diff line change @@ -4,18 +4,16 @@ import kotlinx.serialization.Serializable
44
55sealed class GodotKotlinTreeError : Exception () {
66 override fun getLocalizedMessage (): String = when (this ) {
7- is InvalidGodotProject -> " The project in which GodotNodeTree annotation was used isn't a valid Godot project directory"
87 is GeneratorError -> error.localizedMessage
98 }
109}
1110
12- class InvalidGodotProject : GodotKotlinTreeError ()
13-
1411class GeneratorError (val error : GodotNodeTreeError ) : GodotKotlinTreeError()
1512
1613@Serializable
1714sealed class GodotNodeTreeError : Exception () {
1815 override fun getLocalizedMessage (): String = when (this ) {
16+ is InvalidGodotProject -> " Godot project could not be found at path `$projectPath `."
1917 is ScanningScenesFailed -> " Unable to scan scene files for project at `$projectPath `."
2018 is ReadingSceneFailed -> " Unable to read contens of scene at `$scenePath `."
2119 is UnexpectedNodeParameters -> " A node with unexpected set of parameters encountered: $nodeParams ."
@@ -24,6 +22,9 @@ sealed class GodotNodeTreeError : Exception() {
2422 }
2523}
2624
25+ @Serializable
26+ class InvalidGodotProject (val projectPath : String ) : GodotNodeTreeError()
27+
2728@Serializable
2829class ScanningScenesFailed (val projectPath : String ) : GodotNodeTreeError()
2930
You can’t perform that action at this time.
0 commit comments