From 93425108c5e4bda0af9c1094a4f932dd8fcfa6e6 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 24 Mar 2022 16:20:33 +0100 Subject: [PATCH] Allow GraphQL Error handler return custom Mobilizon.GraphQL.Error directly Signed-off-by: Thomas Citharel --- lib/graphql/error.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/graphql/error.ex b/lib/graphql/error.ex index e412d6465..bcbbfc193 100644 --- a/lib/graphql/error.ex +++ b/lib/graphql/error.ex @@ -72,6 +72,8 @@ defmodule Mobilizon.GraphQL.Error do } end + defp handle(%Error{} = error), do: error + # ... Handle other error types here ... defp handle(other) do Logger.error("Unhandled error term:\n#{inspect(other)}")