Add some useful logging for ApiSpec errors

This commit is contained in:
Mark Felder 2024-06-07 16:03:10 -04:00
parent 5915062874
commit b52d772a6e

View file

@ -18,6 +18,8 @@ defmodule Pleroma.Web.ApiSpec.CastAndValidate do
alias OpenApiSpex.Plug.PutApiSpec
alias Plug.Conn
require Logger
@impl Plug
def init(opts) do
opts
@ -51,6 +53,10 @@ defmodule Pleroma.Web.ApiSpec.CastAndValidate do
conn
{:error, reason} ->
Logger.error(
"Strict ApiSpec: request denied to #{conn.path_info} with params #{inspect(conn.params)}"
)
opts = render_error.init(reason)
conn