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(
36
36
37
37
private fun getProjectPath (rootPath : String , relativePath : String? ): String {
38
38
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()
42
41
}
43
42
44
43
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
4
4
5
5
sealed class GodotKotlinTreeError : Exception () {
6
6
override fun getLocalizedMessage (): String = when (this ) {
7
- is InvalidGodotProject -> " The project in which GodotNodeTree annotation was used isn't a valid Godot project directory"
8
7
is GeneratorError -> error.localizedMessage
9
8
}
10
9
}
11
10
12
- class InvalidGodotProject : GodotKotlinTreeError ()
13
-
14
11
class GeneratorError (val error : GodotNodeTreeError ) : GodotKotlinTreeError()
15
12
16
13
@Serializable
17
14
sealed class GodotNodeTreeError : Exception () {
18
15
override fun getLocalizedMessage (): String = when (this ) {
16
+ is InvalidGodotProject -> " Godot project could not be found at path `$projectPath `."
19
17
is ScanningScenesFailed -> " Unable to scan scene files for project at `$projectPath `."
20
18
is ReadingSceneFailed -> " Unable to read contens of scene at `$scenePath `."
21
19
is UnexpectedNodeParameters -> " A node with unexpected set of parameters encountered: $nodeParams ."
@@ -24,6 +22,9 @@ sealed class GodotNodeTreeError : Exception() {
24
22
}
25
23
}
26
24
25
+ @Serializable
26
+ class InvalidGodotProject (val projectPath : String ) : GodotNodeTreeError()
27
+
27
28
@Serializable
28
29
class ScanningScenesFailed (val projectPath : String ) : GodotNodeTreeError()
29
30
You can’t perform that action at this time.
0 commit comments