fix(resource): improve log security when resource creation fails
This commit is contained in:
parent
4835c30f8c
commit
86a7b2d69a
|
@ -603,7 +603,7 @@ create_or_update_bridge(BridgeType, BridgeName, Conf, HttpStatusCode) ->
|
||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
lookup_from_all_nodes(BridgeType, BridgeName, HttpStatusCode);
|
lookup_from_all_nodes(BridgeType, BridgeName, HttpStatusCode);
|
||||||
{error, Reason} when is_map(Reason) ->
|
{error, Reason} when is_map(Reason) ->
|
||||||
?BAD_REQUEST(map_to_json(Reason))
|
?BAD_REQUEST(map_to_json(emqx_utils:redact(Reason)))
|
||||||
end.
|
end.
|
||||||
|
|
||||||
get_metrics_from_local_node(BridgeType, BridgeName) ->
|
get_metrics_from_local_node(BridgeType, BridgeName) ->
|
||||||
|
|
|
@ -388,7 +388,11 @@ call_start(ResId, Mod, Config) ->
|
||||||
throw:Error ->
|
throw:Error ->
|
||||||
{error, Error};
|
{error, Error};
|
||||||
Kind:Error:Stacktrace ->
|
Kind:Error:Stacktrace ->
|
||||||
{error, #{exception => Kind, reason => Error, stacktrace => Stacktrace}}
|
{error, #{
|
||||||
|
exception => Kind,
|
||||||
|
reason => Error,
|
||||||
|
stacktrace => emqx_utils:redact(Stacktrace)
|
||||||
|
}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec call_health_check(resource_id(), module(), resource_state()) ->
|
-spec call_health_check(resource_id(), module(), resource_state()) ->
|
||||||
|
|
Loading…
Reference in New Issue