{"record":{"id":"93372e1dd5b69233","repo":"apache/beam","slug":"format-args","errorCode":null,"errorMessage":"format, args...","messagePattern":"format, args\\.\\.\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"sdks/go/pkg/beam/internal/errors/errors.go","lineNumber":34,"sourceCode":"// Package errors contains functionality for creating and wrapping errors with improved formatting\n// compared to the standard Go error functionality.\npackage errors\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\n// New returns an error with the given message.\nfunc New(message string) error {\n\treturn fmt.Errorf(\"%s\", message)\n}\n\n// Errorf returns an error with a message formatted according to the format\n// specifier.\nfunc Errorf(format string, args ...any) error {\n\treturn fmt.Errorf(format, args...)\n}\n\n// Wrap returns a new error annotating err with a new message.\nfunc Wrap(err error, message string) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\treturn &beamError{\n\t\tcause: err,\n\t\tmsg:   message,\n\t\ttop:   getTop(err),\n\t}\n}\n\n// Wrapf returns a new error annotating err with a new message according to\n// the format specifier.\nfunc Wrapf(err error, format string, args ...any) error {\n\tif err == nil {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/internal/errors/errors.go#L16-L52","documentation":"internal/errors.Errorf formats a message with fmt.Errorf(format, args...) and returns it. The recorded message \"format, args...\" is just the function signature; the real text comes from the call site's format string and arguments.","triggerScenarios":"Any call to beam/internal/errors.Errorf from Beam internals such as GetArtifact, validate, matchLocations, PutArtifact, extractStagingToPath, or retrieve.","commonSituations":"Encountered during artifact staging/retrieval failures or pipeline validation errors; the underlying cause is described by the formatted message, not this wrapper.","solutions":["Read the formatted message to identify the root cause.","Check the named caller (e.g. GetArtifact/PutArtifact) for the failing operation — often network or artifact-repository issues.","Add errors.Wrap at call sites you control to preserve context."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := op(); err != nil {\n    log.Printf(\"beam op failed: %v\", err) // Errorf message carries the cause\n}","preventionTips":["Read the formatted message for the actual cause.","Wrap calls you control with errors.Wrap to add call-site context."],"tags":["go","errors","wrapper"],"backgroundTag":"internal-invariant-violation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}