diff --git a/build.gradle.kts b/build.gradle.kts index b4862160..ca5e63bc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("ru.mipt.npm.project") } -val dataforgeVersion by extra("0.3.0-dev-1") +val dataforgeVersion by extra("0.3.0-dev-2") val bintrayRepo by extra("dataforge") val githubProject by extra("dataforge-core") diff --git a/dataforge-io/src/jvmMain/kotlin/hep/dataforge/io/fileIO.kt b/dataforge-io/src/jvmMain/kotlin/hep/dataforge/io/fileIO.kt index 46126fac..2f644878 100644 --- a/dataforge-io/src/jvmMain/kotlin/hep/dataforge/io/fileIO.kt +++ b/dataforge-io/src/jvmMain/kotlin/hep/dataforge/io/fileIO.kt @@ -152,8 +152,8 @@ public fun IOPlugin.readEnvelopeFile( path: Path, readNonEnvelopes: Boolean = false, formatPicker: IOPlugin.(Path) -> EnvelopeFormat? = IOPlugin::peekFileEnvelopeFormat, -): Envelope? { - if (!Files.exists(path)) return null +): Envelope { + if (!Files.exists(path)) error("File with path $path does not exist") //read two-files directory if (Files.isDirectory(path)) { @@ -182,7 +182,7 @@ public fun IOPlugin.readEnvelopeFile( path.readEnvelope(format) } ?: if (readNonEnvelopes) { // if no format accepts file, read it as binary SimpleEnvelope(Meta.EMPTY, path.asBinary()) - } else null + } else error("Can't infer format for file $path") } /**