Skip to content

Instantly share code, notes, and snippets.

@Daniel-Jacob
Created March 11, 2022 14:23
Show Gist options
  • Save Daniel-Jacob/8f73599eb55a0785fafe116f2c5770f1 to your computer and use it in GitHub Desktop.
Save Daniel-Jacob/8f73599eb55a0785fafe116f2c5770f1 to your computer and use it in GitHub Desktop.
object ErrorHandler {
fun handleError(error: Error) = when(error) {
is ValidationError -> log.error("a validation error has occured")
is IOError -> log.error("an IO error has occured")
is FatalError -> log.error("a Fatal error has occured... exiting")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment