Problem
DocSpec.Core.EPUB.Writer.convert!/1 and convert!/2 violate Elixir's bang function convention. Bang functions should raise on error and return bare values, but these return {:ok, binary()} | {:error, term()}:
@spec convert!(spec :: DocumentSpecification.t()) :: {:ok, binary()} | {:error, term()}
This surprises every Elixir developer who uses the library — calling convert! and getting back an ok/error tuple is a contract violation.
Expected behavior
Following Elixir convention:
convert/1 → {:ok, binary()} | {:error, term()}
convert!/1 → binary() (raises on error)
Files
lib/docspec/core/epub/writer.ex
lib/docspec/cli.ex (caller)
Notes
This is a breaking change for the public API. Recommend shipping with a major or minor version bump.
Problem
DocSpec.Core.EPUB.Writer.convert!/1andconvert!/2violate Elixir's bang function convention. Bang functions should raise on error and return bare values, but these return{:ok, binary()} | {:error, term()}:This surprises every Elixir developer who uses the library — calling
convert!and getting back an ok/error tuple is a contract violation.Expected behavior
Following Elixir convention:
convert/1→{:ok, binary()} | {:error, term()}convert!/1→binary()(raises on error)Files
lib/docspec/core/epub/writer.exlib/docspec/cli.ex(caller)Notes
This is a breaking change for the public API. Recommend shipping with a major or minor version bump.