Skip to content

Commit

Permalink
add line number to history-parsing error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-williams committed Feb 12, 2015
1 parent b668b52 commit 8deecf0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,20 @@ private[spark] class ReplayListenerBus extends SparkListenerBus with Logging {
*/
def replay(logData: InputStream, version: String) {
var currentLine: String = null
var lineNumber: Int = 1
try {
val lines = Source.fromInputStream(logData).getLines()
lines.foreach { line =>
currentLine = line
postToAll(JsonProtocol.sparkEventFromJson(parse(line)))
lineNumber += 1
}
} catch {
case ioe: IOException =>
throw ioe
case e: Exception =>
logError("Exception in parsing Spark event log.", e)
logError("Malformed line: %s\n".format(currentLine))
logError(s"Malformed line #$lineNumber: $currentLine\n")
}
}

Expand Down

0 comments on commit 8deecf0

Please sign in to comment.