File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
jupyter-lib/shared-compiler/src/main/kotlin/org/jetbrains/kotlinx/jupyter/libraries Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,6 @@ import org.jetbrains.kotlinx.jupyter.protocol.api.KernelLoggerFactory
9
9
10
10
private val jsonParser = Json { ignoreUnknownKeys = true }
11
11
12
- private inline fun <T > parseCatching (
13
- descriptor : T ,
14
- parse : (T ) -> LibraryDescriptor ,
15
- ): LibraryDescriptor =
16
- try {
17
- parse(descriptor)
18
- } catch (e: SerializationException ) {
19
- throw ReplException (" Error during library deserialization. Library descriptor text:\n $descriptor " , e)
20
- }
21
-
22
12
fun parseLibraryDescriptor (json : String ): LibraryDescriptor =
23
13
parseCatching(json) {
24
14
jsonParser.decodeFromString(it)
@@ -39,3 +29,19 @@ fun parseLibraryDescriptors(
39
29
parseLibraryDescriptor(it.value)
40
30
}
41
31
}
32
+
33
+ private inline fun <T > parseCatching (
34
+ descriptor : T ,
35
+ parse : (T ) -> LibraryDescriptor ,
36
+ ): LibraryDescriptor =
37
+ try {
38
+ parse(descriptor)
39
+ } catch (e: SerializationException ) {
40
+ throw ReplException (
41
+ " Error during library deserialization. " +
42
+ " Read about library descriptor format at " +
43
+ " https://github.com/Kotlin/kotlin-jupyter/blob/master/docs/libraries.md#creating-a-library-descriptor\n " +
44
+ " Library descriptor text:\n $descriptor " ,
45
+ e,
46
+ )
47
+ }
You can’t perform that action at this time.
0 commit comments