diff --git a/lib/discord.ex b/lib/discord.ex
index 0af48cb..3d6aa1f 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] do
+ reason = if (params.reason.message rescue nil) do
type = params.reason.__struct__
"#{type}: #{params.reason.message}"
else