diff --git a/lib/discord.ex b/lib/discord.ex
index 3d6aa1f..04e65d6 100644
--- a/lib/discord.ex
+++ b/lib/discord.ex
@@ -2,7 +2,7 @@ defmodule Discord do
def error(params) do
url = Application.get_env(:kmxgit, :discord_errors_webhook)
- reason = if (params.reason.message rescue nil) do
+ reason = if (try do params.reason.message rescue _ -> nil end) do
type = params.reason.__struct__
"#{type}: #{params.reason.message}"
else