Skip to content

Commit ca716d4

Browse files
Minor formatting improvement
1 parent f2ef3bf commit ca716d4

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

deps/rabbitmq_auth_backend_oauth2/src/rabbit_oauth2_schema.erl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ extract_scope_alias_mapping(Proplist) ->
6666
S -> convert_space_separated_string_to_list_of_binaries(S)
6767
end,
6868
case {Alias, Scope} of
69-
{{error, _} = Err0, _} ->
70-
rabbit_log:error("Skipped wrong scope_aliases configuration: ~p",
71-
[Err0]),
69+
{{error, _}, _} ->
70+
cuttlefish:warn(
71+
"Skipped scope_aliases due to missing alias attribute"),
7272
{};
73-
{_, {error, _} = Err1 } ->
74-
rabbit_log:error("Skipped wrong scope_aliases configuration: ~p",
75-
[Err1]),
73+
{_, {error, _}} ->
74+
cuttlefish:warn(
75+
"Skipped scope_aliases due to missing scope attribute"),
7676
{};
7777
_ = V -> V
7878
end.
@@ -168,8 +168,9 @@ translate_list_of_signing_keys(ListOfKidPath) ->
168168
{ok, Bin} ->
169169
string:trim(Bin, trailing, "\n");
170170
_Error ->
171-
%% this throws and makes Cuttlefish treak the key as invalid
172-
cuttlefish:invalid("file does not exist or cannot be read by the node")
171+
cuttlefish:invalid(io_lib:format(
172+
"File ~p does not exist or cannot be read by the node",
173+
[Path]))
173174
end
174175
end,
175176
maps:map(fun(_K, Path) -> {pem, TryReadingFileFun(Path)} end,
@@ -180,9 +181,9 @@ validator_file_exists(Attr, Filename) ->
180181
{ok, _} ->
181182
Filename;
182183
_Error ->
183-
%% this throws and makes Cuttlefish treak the key as invalid
184184
cuttlefish:invalid(io_lib:format(
185-
"Invalid attribute (~p) value: file ~p does not exist or cannot be read by the node", [Attr, Filename]))
185+
"Invalid attribute (~p) value: file ~p does not exist or " ++
186+
"cannot be read by the node", [Attr, Filename]))
186187
end.
187188
validator_https_uri(Attr, Uri) when is_binary(Uri) ->
188189
list_to_binary(validator_https_uri(Attr, binary_to_list(Uri)));
@@ -192,7 +193,8 @@ validator_https_uri(Attr, Uri) ->
192193
true -> Uri;
193194
false ->
194195
cuttlefish:invalid(io_lib:format(
195-
"Invalid attribute (~p) value: uri ~p must be a valid https uri", [Attr, Uri]))
196+
"Invalid attribute (~p) value: uri ~p must be a valid " ++
197+
"https uri", [Attr, Uri]))
196198
end.
197199

198200
merge_list_of_maps(ListOfMaps) ->

0 commit comments

Comments
 (0)