diff --git a/lib/avrogen/schema/schema_registry.ex b/lib/avrogen/schema/schema_registry.ex index ebf0024..7e90eee 100644 --- a/lib/avrogen/schema/schema_registry.ex +++ b/lib/avrogen/schema/schema_registry.ex @@ -40,9 +40,8 @@ defmodule Avrogen.Schema.SchemaRegistry do end) |> Avrogen.Schema.topological_sort() |> Noether.Either.map(fn schemas -> - json = Jason.encode!(schemas) - try do + json = Jason.encode!(schemas) encoder = make_encoder(json) decoder = make_decoder(json) :ets.insert(__MODULE__, {@ets_name, json, encoder, decoder}) @@ -51,11 +50,10 @@ defmodule Avrogen.Schema.SchemaRegistry do formatted_error = Exception.format(:error, e, __STACKTRACE__) Logger.error( - "Error when attempting to make encoder/decoder: #{formatted_error}; schemas: #{inspect(schemas, limit: :infinity, pretty: true, printable_limit: :infinity)} schemas_json: #{json}", + "Error when attempting to make encoder/decoder: #{formatted_error}; schemas: #{inspect(schemas, limit: :infinity, pretty: true, printable_limit: :infinity)}", %{ error: formatted_error, - schemas: schemas, - schemas_json: json + schemas: schemas } )