Skip to content

Commit

Permalink
PISTON-1086:Fixed incorrectly formatted kazoo_document validation sys…
Browse files Browse the repository at this point in the history
…tem error responses (#6698)
  • Loading branch information
bradfordben authored Mar 31, 2021
1 parent a818d06 commit 86852fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/kazoo_documents/src/kzd_module_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ validate_schema(<<Schema/binary>>, {Doc, ValidationErrors}, OnSuccess) ->
{'ok', SchemaJObj} -> validate_schema(SchemaJObj, {Doc, ValidationErrors}, OnSuccess);
{'error', 'not_found'} when SchemaRequired ->
lager:error("~s schema not found and is required", [Schema]),
throw({'system_error', <<"schema '", Schema/binary, "' not found.">>});
throw({'system_error', {'datastore_fault', <<"schema '", Schema/binary, "' not found.">>}});
{'error', 'not_found'} ->
lager:error("~s schema not found, assuming schema validation passed, continuing anyway", [Schema]),
validate_schema_passed({Doc, ValidationErrors}, OnSuccess)
Expand All @@ -90,7 +90,7 @@ validate_schema(SchemaJObj, {Doc, ValidationErrors}, OnSuccess) ->
?STACKTRACE('error', 'function_clause', ST)
lager:error("function clause failure"),
kz_util:log_stacktrace(ST),
throw({'system_error', <<"schema validation failed to run on the server">>})
throw({'system_error', {'function_clause', <<"function clause failure - schema validation failed to run on the server">>}})
end.

%%------------------------------------------------------------------------------
Expand Down

0 comments on commit 86852fe

Please sign in to comment.