Loggeo proceso
This commit is contained in:
		| @ -97,17 +97,20 @@ defmodule ApiWeb.Redirect do | |||||||
|         res -> |         res -> | ||||||
|           res.idstudy |           res.idstudy | ||||||
|       end |       end | ||||||
|  |     Logger.info("idstudy obtenido: #{inspect(idstudy)}") | ||||||
|     idstudy_str = to_string(idstudy) |     idstudy_str = to_string(idstudy) | ||||||
|  |  | ||||||
|     case Req.post(url, json: %{"idstudy" => idstudy_str, "expiration" => expiration}) do |     case Req.post(url, json: %{"idstudy" => idstudy_str, "expiration" => expiration}) do | ||||||
|       {:ok, %Req.Response{status: 200, body: %{"hash" => hash}}} -> |       {:ok, %Req.Response{status: 200, body: %{"hash" => hash}}} -> | ||||||
|  |         Logger.info("hash obtenido: #{inspect(hash)}") | ||||||
|         {:ok, hash} |         {:ok, hash} | ||||||
|  |  | ||||||
|       {:ok, %Req.Response{status: status, body: body}} -> |       {:ok, %Req.Response{status: status, body: body}} -> | ||||||
|  |         Logger.error("Error inesperado al obtener hash: #{status} - #{inspect(body)}") | ||||||
|         {:error, {:unexpected_response, status, body}} |         {:error, {:unexpected_response, status, body}} | ||||||
|  |  | ||||||
|       {:error, reason} -> |       {:error, reason} -> | ||||||
|  |         Logger.error("Error de request al obtener hash: #{inspect(reason)}") | ||||||
|         {:error, {:request_failed, reason}} |         {:error, {:request_failed, reason}} | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user