Skip to content

Commit

Permalink
error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Feb 5, 2024
1 parent db59b77 commit c7612ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/up_rest.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ defmodule UP.HTTP do
"id" => UP.account(account, :id),
"spec" => spec }]))
end
_ -> :io.format 'PUT:/#{type} AUTH FAILED: ~p~n', [auth]
_ -> :io.format 'PUT:/#{type} SEC AUTH FAILED: ~p~n', [auth]
send_resp(conn, 400,
encode([%{ "error" => "Authorization",
"text" => "Security admin key doesn't match." }])) end end
Expand All @@ -97,7 +97,7 @@ defmodule UP.HTTP do
"spec" => spec }]))
_ -> send_resp(conn, 400,
encode([%{ "error" => "Authorization",
"text" => "Security admin key doesn't match." }])) end end
"text" => "Account key doesn't match." }])) end end

def put3(conn, _, type, _, _) do
send_resp(conn, 400,
Expand All @@ -114,7 +114,7 @@ defmodule UP.HTTP do
accounts = :lists.map(fn x -> UP.Serial.fromRecord(x) end, :kvs.all("/#{type}"))
:io.format 'GET:/#{type}/#{spec} LIST ~p', [accounts]
send_resp(conn, 200, encode([%{"type" => type, "spec" => spec, "result" => accounts }]))
_ -> :io.format 'GET:/#{type} AUTH FAILED: ~p~n', [auth]
_ -> :io.format 'GET:/#{type} SEC AUTH FAILED: ~p~n', [auth]
send_resp(conn, 400,
encode([%{ "error" => "Authorization",
"text" => "Security admin key doesn't match." }])) end end
Expand Down

0 comments on commit c7612ec

Please sign in to comment.