Add some useful logging for ApiSpec errors
This commit is contained in:
parent
5915062874
commit
b52d772a6e
@ -18,6 +18,8 @@ defmodule Pleroma.Web.ApiSpec.CastAndValidate do
|
|||||||
alias OpenApiSpex.Plug.PutApiSpec
|
alias OpenApiSpex.Plug.PutApiSpec
|
||||||
alias Plug.Conn
|
alias Plug.Conn
|
||||||
|
|
||||||
|
require Logger
|
||||||
|
|
||||||
@impl Plug
|
@impl Plug
|
||||||
def init(opts) do
|
def init(opts) do
|
||||||
opts
|
opts
|
||||||
@ -51,6 +53,10 @@ defmodule Pleroma.Web.ApiSpec.CastAndValidate do
|
|||||||
conn
|
conn
|
||||||
|
|
||||||
{:error, reason} ->
|
{:error, reason} ->
|
||||||
|
Logger.error(
|
||||||
|
"Strict ApiSpec: request denied to #{conn.path_info} with params #{inspect(conn.params)}"
|
||||||
|
)
|
||||||
|
|
||||||
opts = render_error.init(reason)
|
opts = render_error.init(reason)
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|
Loading…
Reference in New Issue
Block a user