MCPcopy Index your code
hub / github.com/github/gh-aw / printCompilationError

Function printCompilationError

pkg/cli/add_command.go:853–862  ·  view source on GitHub ↗

printCompilationError formats and writes a compilation error to stderr. Redirect-only workflow errors are treated as informational messages rather than errors, since they occur when a redirect placeholder was downloaded without resolving to the full workflow content. In that case the user is directe

(err error, quiet bool)

Source from the content-addressed store, hash-verified

851// workflow content. In that case the user is directed to run `gh aw update`.
852// All other errors are written using FormatErrorChain for standard error formatting.
853func printCompilationError(err error, quiet bool) {
854 var redirectErr *workflow.RedirectOnlyWorkflowError
855 if errors.As(err, &redirectErr) {
856 if !quiet {
857 fmt.Fprintln(os.Stderr, console.FormatInfoMessage(redirectErr.Error()))
858 }
859 return
860 }
861 fmt.Fprintln(os.Stderr, console.FormatErrorChain(err))
862}
863
864// isCopilotWorkflowContent returns true when the workflow frontmatter declares engine: copilot.
865// It is used to guard AddCopilotRequestsPermission injection so that the flag is only applied

Callers 1

compileAddedWorkflowFunction · 0.85

Calls 3

ErrorMethod · 0.95
FormatInfoMessageFunction · 0.92
FormatErrorChainFunction · 0.92

Tested by

no test coverage detected