-
Notifications
You must be signed in to change notification settings - Fork 82
Conversation
…eption during deserialization. In general, would like to clean up exception handling and replace messages with slf or jdk logging.
could you inherit from SerializableLogging (or something) and just use logger.error ? |
could you also try adding ", true" to the readObject call on line 44, and see if that fixes the problem? |
Modifying the readObject call did not help: As for the logging, I should have mentioned a reason to use a formal logger is for message redirection when the code is used in a larger container. I will look at |
Some progress: When I modify https://github.com/briantopping/epic/blob/pr32/src/main/scala/epic/models/package.scala#L21-21 to |
blah, ok. On Thu, May 14, 2015 at 2:45 AM, Brian Topping notifications@github.com
|
@@ -57,8 +57,8 @@ package object models { | |||
try { | |||
readFromJar("", f) | |||
} catch { | |||
case ex: IOException => | |||
throw new RuntimeException(s"Could not find model $model in path $path") | |||
case ex: Exception => |
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.
Why Exception
and not Throwable
?
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.
I didn't spend a lot of time on it, probably could be improved!
Expose swallowed exception that was hiding an java.io.InvalidClassException during deserialization.
Would like to follow on with moving output to Java logging or slf4j. It would be a great way for me to get familiar with the code and give back something at the same time. The code that I patched here has an "expected" exception that fires off a call to
classPathLoad
, but in this case, only anIOException
was expected, so it wasn't caught or logged, resulting in another error that could have been anything. This is one of the challenges with using runtime exceptions, but it's pretty easy to just put in a top-level exception handler to dump the trace as well.