in Sources/XCMetricsClient/Mobius/Effect Handlers/DumpParser/JSONMetricsParserFactory.swift [102:128]
func buildNoticeParser(defaultType: NoticeType) -> (Data) throws -> NoticeInfo {
return { data in
let representation = try JSONMetricsParserFactory.parseJSON(data)
guard representation["buildIdentifier"] != nil else {
throw MetricsParserError.missingKey("buildIdentifier")
}
let notice = Notice(
type: NoticeType(rawValue: representation.fetch("type")) ?? defaultType,
title: representation.fetch("title"),
clangFlag: representation.fetch("clangFlag"),
documentURL: representation.fetch("documentURL"),
severity: representation.fetch("severity"),
startingLineNumber: representation.fetch("startingLine"),
endingLineNumber: representation.fetch("endingLine"),
startingColumnNumber: representation.fetch("startingColumn"),
endingColumnNumber: representation.fetch("endingColumn"),
characterRangeEnd: representation.fetch("characterRangeStart"),
characterRangeStart: representation.fetch("characterRangeEnd"),
interfaceBuilderIdentifier: representation.fetch("interfaceBuilderIdentifier")
)
let parentIdentifier: String = representation.fetch("parentIdentifier")
return NoticeInfo(notice: notice,
parentIdentifier: parentIdentifier)
}
}