You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(minutes,vc): emit typed error envelopes across both domains
Failures from the minutes and video-conference commands now surface as
structured, typed errors carrying a stable category and subtype — spanning
input validation, missing permissions, network and file-I/O failures, and
remote API errors — so callers can branch on the error kind instead of
parsing free-form text. Batch commands report partial failures explicitly,
emitting per-item results with a non-zero exit instead of masking them.
returnoutput.ErrValidation("--minute-tokens is required")
58
+
returnerrs.NewValidationError(errs.SubtypeInvalidArgument, "--minute-tokens is required").WithParam("--minute-tokens")
58
59
}
59
60
iflen(tokens) >maxBatchSize {
60
-
returnoutput.ErrValidation("--minute-tokens: too many tokens (%d), maximum is %d", len(tokens), maxBatchSize)
61
+
returnerrs.NewValidationError(errs.SubtypeInvalidArgument, "--minute-tokens: too many tokens (%d), maximum is %d", len(tokens), maxBatchSize).WithParam("--minute-tokens")
61
62
}
62
63
for_, token:=rangetokens {
63
64
if!validMinuteToken.MatchString(token) {
64
-
returnoutput.ErrValidation("invalid minute token %q: must contain only lowercase alphanumeric characters (e.g. obcnq3b9jl72l83w4f149w9c)", token)
65
+
returnerrs.NewValidationError(errs.SubtypeInvalidArgument, "invalid minute token %q: must contain only lowercase alphanumeric characters (e.g. obcnq3b9jl72l83w4f149w9c)", token).WithParam("--minute-tokens")
65
66
}
66
67
}
67
68
// Cheap checks first, then path-safety resolution.
68
69
out:=runtime.Str("output")
69
70
outDir:=runtime.Str("output-dir")
70
71
ifout!=""&&outDir!="" {
71
-
returnoutput.ErrValidation("--output and --output-dir cannot both be set")
72
+
returnerrs.NewValidationError(errs.SubtypeInvalidArgument, "--output and --output-dir cannot both be set").WithParam("--output")
@@ -112,15 +113,15 @@ var MinutesDownload = common.Shortcut{
112
113
explicitOutputPath=""
113
114
casestatErr==nil&&!fi.IsDir():
114
115
if!single {
115
-
returnoutput.ErrValidation("--output %q is a file; batch mode expects a directory (use --output-dir)", explicitOutputPath)
116
+
returnerrs.NewValidationError(errs.SubtypeInvalidArgument, "--output %q is a file; batch mode expects a directory (use --output-dir)", explicitOutputPath).WithParam("--output")
0 commit comments