diff options
author | Edoardo La Greca | 2025-08-09 19:22:29 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-08-09 19:22:29 +0200 |
commit | 5316ed0c6e4200195c6031651e285f61bb1424ab (patch) | |
tree | 900ec0cb7ff93475a07974ebf2fbfc265cbef32f | |
parent | 8e5b09c28644fba6078728aacf515d1af8c218ba (diff) |
change UnaccessibleFileException to accept a path as a list instead of a string
-rw-r--r-- | src/main/kotlin/except/UnaccessibleFileException.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/kotlin/except/UnaccessibleFileException.kt b/src/main/kotlin/except/UnaccessibleFileException.kt index 23dce0d..07d5d13 100644 --- a/src/main/kotlin/except/UnaccessibleFileException.kt +++ b/src/main/kotlin/except/UnaccessibleFileException.kt @@ -4,7 +4,8 @@ package except * This exception is thrown when the file that the client is trying to open (or walk through, in case of a directory) * cannot be accessed. * - * @param path The path that the client tried to access, up to the first element that cannot be accessed (e.g. if the - * path the user wants to access is `/usr/foo/bar/zib` but `bar` does not exist, then [path] must be `/usr/foo/bar`). + * @param path The path, as a list of path elements, that the client tried to access, up to and including the first + * element that cannot be accessed (e.g. if the path the user wants to access is `["usr", "foo", "bar", "zib"]` but + * `bar` does not exist, then [path] must be `["usr", "foo", "bar"]`). */ -class UnaccessibleFileException(val path: String) : Exception("Cannot access file ${path}.")
\ No newline at end of file +class UnaccessibleFileException(val path: List<String>) : Exception("Could not walk to file ${path.joinToString(separator = "/")}.")
\ No newline at end of file |