From 5a6bc0cd1d9db6cdf444f3a8b8989b9a202adf57 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Tue, 13 Dec 2022 17:47:58 -0500 Subject: [PATCH] fix: show all errors on `show_raised_errors` --- lib/graphql/resolver.ex | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/graphql/resolver.ex b/lib/graphql/resolver.ex index 3d70ee4..13de032 100644 --- a/lib/graphql/resolver.ex +++ b/lib/graphql/resolver.ex @@ -1461,9 +1461,19 @@ defmodule AshGraphql.Graphql.Resolver do "`#{uuid}`: AshGraphql.Error not implemented for error:\n\n#{Exception.format(:error, error, stacktrace)}" ) - %{ - message: "Something went wrong. Unique error id: `#{uuid}`" - } + if AshGraphql.Api.Info.show_raised_errors?(api) do + %{ + message: """ + Raised error: #{uuid} + + #{Exception.format(:error, error, stacktrace)}" + """ + } + else + %{ + message: "Something went wrong. Unique error id: `#{uuid}`" + } + end end end)} end