Skip to content

Commit

Permalink
[query] improve error message when rng_nonce is unparseable (hail-is#…
Browse files Browse the repository at this point in the history
…12688)

* [query] improve error message when rng_nonce is unparseable

* Update ExecuteContext.scala
  • Loading branch information
danking authored Feb 13, 2023
1 parent 2aba588 commit 52feb78
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hail/src/main/scala/is/hail/backend/ExecuteContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import is.hail.{HailContext, HailFeatureFlags}
import is.hail.annotations.{Region, RegionPool}
import is.hail.expr.ir.Threefry
import is.hail.io.fs.FS
import is.hail.utils.{ExecutionTimer, using}
import is.hail.utils._
import is.hail.variant.ReferenceGenome

import java.io._
Expand Down Expand Up @@ -111,7 +111,12 @@ class ExecuteContext(
) extends Closeable {
var backendContext: BackendContext = _

val rngNonce: Long = java.lang.Long.decode(getFlag("rng_nonce"))
val rngNonce: Long = try {
java.lang.Long.decode(getFlag("rng_nonce"))
} catch {
case exc: NumberFormatException =>
fatal(s"Could not parse flag rng_nonce as a 64-bit signed integer: ${getFlag("rng_nonce")}", exc)
}

private val tempFileManager: TempFileManager = if (_tempFileManager != null)
_tempFileManager
Expand Down

0 comments on commit 52feb78

Please sign in to comment.