Last active
December 16, 2015 13:29
-
-
Save christo/5441689 to your computer and use it in GitHub Desktop.
Example groovy code ignoring exceptions.
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
class Config { | |
def threads = 8 | |
// ... | |
def configure(Map config) { | |
try { | |
threads = Integer.parseInt(config?.threads as String) | |
} catch (NumberFormatException ignore) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment