Skip to content

Commit

Permalink
Scala Common Enrich: added validation that v_collector is set (closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
fblundun committed Sep 25, 2015
1 parent 4c28448 commit dcf0e74
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ object EnrichmentManager {

val secondPassTransform = event.transform(sourceMap, secondPassTransformMap)

// The load fails if the collector version is not set
val collectorVersionSet = event.v_collector match {
case ("" | null) => "Collector version not set".fail
case _ => unitSuccess
}

// Potentially update the page_url and set the page URL components
val pageUri = WPE.extractPageUri(raw.context.refererUri, Option(event.page_url))
for (uri <- pageUri; u <- uri) {
Expand Down Expand Up @@ -429,10 +435,11 @@ object EnrichmentManager {
collectorTstamp.toValidationNel |@|
client.toValidationNel |@|
uaParser.toValidationNel |@|
collectorVersionSet.toValidationNel |@|
pageUri.toValidationNel |@|
geoLocation.toValidationNel |@|
refererUri.toValidationNel) {
(_,_,_,_,_,_,_) => ()
(_,_,_,_,_,_,_,_) => ()
}
val second =
(transform |@|
Expand Down

0 comments on commit dcf0e74

Please sign in to comment.