Skip to content

Instantly share code, notes, and snippets.

@christo
Last active December 16, 2015 13:29
Show Gist options
  • Save christo/5441689 to your computer and use it in GitHub Desktop.
Save christo/5441689 to your computer and use it in GitHub Desktop.
Example groovy code ignoring exceptions.
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