From cea8c5a7fe45be1b91e46ba7b3a8a56bf74feebc Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Tue, 17 Jan 2023 01:00:36 +0100 Subject: [PATCH] Fix GraphQL API error messages --- src/db/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db/mod.rs b/src/db/mod.rs index 20b60b4..2ddf33a 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -46,9 +46,10 @@ impl std::fmt::Display for DatabaseError { impl IntoFieldError for DatabaseError { fn into_field_error(self) -> juniper::FieldError { + let short = self.short; FieldError::new( self.long, - graphql_value!({ "error": "Connection refused" }), + graphql_value!({ "error": short }), ) } }