Skip to content

Commit

Permalink
Merge pull request #1505 from cashapp/jwilson.0117.nicer_error
Browse files Browse the repository at this point in the history
Friendlier error when freshAtEpochMs is null
  • Loading branch information
squarejesse authored Jan 17, 2025
2 parents 136188d + a75494c commit 5e737ce
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ internal fun LoadedManifest(manifestBytes: ByteString, freshAtEpochMs: Long): Lo

internal fun LoadedManifest(manifestBytes: ByteString): LoadedManifest {
val manifest = ZiplineManifest.decodeJson(manifestBytes.utf8())
return LoadedManifest(manifestBytes, manifest, manifest.freshAtEpochMs!!)
val freshAtEpochMs = manifest.freshAtEpochMs
?: error("freshAtEpochMs is required for loaded manifests, but was null")
return LoadedManifest(manifestBytes, manifest, freshAtEpochMs)
}

0 comments on commit 5e737ce

Please sign in to comment.