Created
August 9, 2013 04:51
-
-
Save yayj/6191267 to your computer and use it in GitHub Desktop.
Future.onSuccess and Future.onFailure
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
future.onFailure { | |
case e: Exception => | |
Logger.warn("SMS: Error: " + e.getMessage) | |
case _ => | |
Logger.warn("SMS: Unknown error") | |
} | |
future.onSuccess { | |
case response: Response => | |
response.status match { | |
case 200 => | |
case _ => | |
Logger.warn("Failed to send SMS") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment