Repository navigation
feat!: raise BuildError instead of exiting from a failed build - #483
Merged
Merged
Conversation
Export `BuildError`, a `RuntimeError` subclass, for documentation builds that leave no usable site. Include it in the API reference. No build path raises it yet.
Raise `BuildError` instead of exiting when API reference generation fails, every version of a multi-version site fails, or Quarto fails to render. Also raise it when a configured reference name is missing from an installed package, both during builds and when querying documented symbols. Derive missing and outdated Quarto errors from `BuildError`, preserving their `RuntimeError` base. Library callers can catch build failures as ordinary exceptions, and failed builds no longer stop the MCP server. Report each failure once, with unchanged wording, before raising it: in the build log, or on standard error for missing Quarto or reference names. - Exit `great-docs build` and `great-docs preview` with status 1 without printing the failure again. - Print the missing-name error and exit `great-docs api-snapshot` with status 1 instead of showing a traceback. - Return an MCP build error result with the message and build log. - Leave `great-docs freeze` unchanged: it still carries on when preparation fails.
When build preparation fails, exit `great-docs freeze` with status 1 after the failure has been reported. Render no pages. Previously the command ignored a failed preparation, for example a configured reference name missing from the installed package, and went on to render pages from a half-prepared build directory.
📚 Preview this PR's docs locallyFetch the just-built site and open it in your browser: # this exact build
great-docs preview --run 41037553527
# or always the latest build for this PR
great-docs preview --pr 483Auth & tips
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GreatDocs.build()now raises a new publicBuildErrorwhen a build fails, instead of ending the process. It used to callsys.exit(1)when the API reference could not be generated, when every version of a multi-version site failed, or when Quarto failed to render, and a configured reference name missing from the installed package raisedSystemExit. Code that calls great-docs as a library could not catch these as ordinary exceptions, and a failed build over the MCP server could stop the server.BuildErrorderives fromRuntimeError, as do the existing errors for a missing or outdated Quarto, which now derive from it. Each failure is still reported once with the same wording.great-docs buildandgreat-docs previewstill exit with status 1,great-docs api-snapshotprints the missing-name error instead of a traceback, and the MCP build tool returns an error with the build log.great-docs freezenow stops with status 1 when preparing the build fails, where it used to render pages from a half-prepared build directory.