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: emit typed error envelopes for minutes and vc commands
Failures from the minutes and video-conference commands now carry a stable
error category and subtype instead of free-form text, so callers can tell
apart invalid input, missing permissions, and network or service failures
without scraping messages. Errors raised at the remote API boundary keep
their current form until the typed request path is in place.
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