Last active
August 29, 2015 14:09
-
-
Save tpanagos/8daebc0a555a05c835a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
//dangerous java calls | |
} | |
catch { | |
//Gracefully catch any exceptions that might generate from the Java call or the JSON handling. | |
case e: Exception => { | |
status = "FAIL" | |
err_msg = "Err: " + e.getMessage + " Cause: " + e.getCause | |
//anything else | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val paramMap: JsObject = (Try(parameterMap.getValue(execution).asInstanceOf[JsObject]) match { | |
case Success(myObj: JsObject) => { | |
myObj | |
} | |
case Failure(myException) => { | |
foo | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment