-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More expressive primary service init failure #476
base: dev
Are you sure you want to change the base?
Conversation
# Conflicts: # CHANGELOG.md # src/main/scala/edu/ie3/simona/service/primary/PrimaryServiceWorker.scala
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the initiative. Some short questions from my side here. Also, the test for PSW needs to be adapted once this is done, of course.
@@ -28,6 +28,7 @@ simona.input.primary.csvParams = { | |||
directoryPath: "input/samples/vn_simona/fullGrid" | |||
csvSep: "," | |||
isHierarchic: false | |||
timePattern: "yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the default time pattern, so this line effectively does not change any configuraiton. Does it make sense to include it?
case Failure(exc: DateTimeParseException) => | ||
throw new IOException( | ||
s"Could not initiate the time series source. Parsing ${exc.getParsedString} failed with timepattern: $timePattern. The time pattern can be configured in the configuration.", | ||
exc | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want this kind of distinction, would'nt it rather make sense to have it in PSDM?
So, everything that can go wrong within *TimeSeriesSource is fully described by an exception that its constructor throws. Then, when we arrive at the level of PrimaryServiceWorker, we can then wrap the exception once more and say: "During creation of the timeseries source, an error occured." or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly solved here (or with an earlier PR). We should still check if DateTimeParseException
is also wrapped in a SourceException
within PSDM
valueClass, | ||
factory | ||
) | ||
) match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error matching would also be nice for SqlTimeSeriesSource as well, no? So maybe we can move this an abstraction level upwards, i.e. checking for Failure
after *TimeSeriesSource has been created.
Resolves #475