1 package net.pterodactylus.util.exception
4 * Runs the given [runnable][Runnable], catching any [exceptions][Exception],
5 * and running the [errorRunnable][Runnable] with a caught exception.
7 * @param runnable The block to run
8 * @param errorRunnable The block to run in case of an exception
10 fun suppressException(runnable: () -> Unit = {}, errorRunnable: (e: Exception) -> Unit = {}): () -> Unit = {
13 } catch (e: Exception) {