Spaces:
Sleeping
Sleeping
Scott Hiett
commited on
Commit
·
2b07033
1
Parent(s):
6c22d58
Make connection error throw an Upstash Error
Browse files
lib/srh/http/base_router.ex
CHANGED
@@ -89,7 +89,7 @@ defmodule Srh.Http.BaseRouter do
|
|
89 |
%{code: 401, message: message, json: false}
|
90 |
|
91 |
{:connection_error, message} ->
|
92 |
-
%{code: 500, message: message, json:
|
93 |
|
94 |
{:server_error, _} ->
|
95 |
%{code: 500, message: "An error occurred internally", json: false}
|
|
|
89 |
%{code: 401, message: message, json: false}
|
90 |
|
91 |
{:connection_error, message} ->
|
92 |
+
%{code: 500, message: Jason.encode!(%{error: message}), json: true}
|
93 |
|
94 |
{:server_error, _} ->
|
95 |
%{code: 500, message: "An error occurred internally", json: false}
|
lib/srh/http/command_handler.ex
CHANGED
@@ -194,7 +194,7 @@ defmodule Srh.Http.CommandHandler do
|
|
194 |
|
195 |
{
|
196 |
:connection_error,
|
197 |
-
"Unable to connect to the Redis server"
|
198 |
}
|
199 |
|
200 |
_ ->
|
|
|
194 |
|
195 |
{
|
196 |
:connection_error,
|
197 |
+
"SRH: Unable to connect to the Redis server. See SRH logs for more information."
|
198 |
}
|
199 |
|
200 |
_ ->
|