Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
libraries
Mapper Service Configuration
Commits
f38973eb
Commit
f38973eb
authored
Oct 27, 2020
by
Jonas Waeber
Browse files
Remove exit process and instead throw / rethrow errors.
parent
eb920a7d
Pipeline
#16167
passed with stage
in 2 minutes and 3 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/main/kotlin/mapping/MappingConfigurationParser.kt
View file @
f38973eb
...
...
@@ -23,7 +23,6 @@ import ch.memobase.mapping.fields.DirectMapField
import
ch.memobase.mapping.fields.FieldParsers
import
ch.memobase.mapping.fields.SimpleAnnotationField
import
ch.memobase.mapping.mappers.DateFieldMapper
import
kotlin.system.exitProcess
import
mapping.MapperConfiguration
import
mapping.MapperParsers
import
mapping.mappers.AbstractFieldMapper
...
...
@@ -58,22 +57,19 @@ class MappingConfigurationParser(data: ByteArray) {
else
->
log
.
error
(
"Top level definition of the mapping definition must be a map."
)
}
}
}
catch
(
ex
:
InvalidMappingException
)
{
log
.
error
(
"Invalid Mapping: "
+
ex
.
message
)
exitProcess
(
1
)
}
catch
(
ex
:
ClassCastException
)
{
log
.
error
(
"Invalid Structure: "
+
ex
.
message
)
exitProcess
(
1
)
throw
InvalidMappingException
(
"Invalid Structure: "
+
ex
.
message
)
}
if
(
uriField
==
""
)
{
log
.
error
(
"Mapping is missing uri field in record, which is required."
)
exitProcess
(
1
)
throw
InvalidMappingException
(
"Mapping is missing uri field in record, which is required."
)
}
if
(
localRecordType
!=
null
)
{
recordType
=
localRecordType
as
SimpleAnnotationField
}
else
{
log
.
error
(
"Mapping is missing record.type field which is required."
)
exitProcess
(
1
)
throw
InvalidMappingException
(
"Mapping is missing record.type field which is required."
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment