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(okr,whiteboard): emit typed error envelopes across both domains
The okr and whiteboard commands now report every failure as a typed error
envelope. Invalid flags, malformed input, output-file conflicts, and API or
transport failures alike carry a stable category, subtype, the offending flag
or Lark error code, and a meaningful exit code — so scripts and agents can
branch on the error shape instead of scraping message strings.
returnerrs.NewValidationError(errs.SubtypeInvalidArgument, "--file is required").WithParam("--file")
47
47
}
48
48
ext:=strings.ToLower(filepath.Ext(filePath))
49
49
if!allowedImageExts[ext] {
50
-
returncommon.FlagErrorf("--file must be an image (supported: JPG, JPEG, PNG, GIF, BMP), got %q", ext)
50
+
returnerrs.NewValidationError(errs.SubtypeInvalidArgument, "--file must be an image (supported: JPG, JPEG, PNG, GIF, BMP), got %q", ext).WithParam("--file")
51
51
}
52
52
53
53
targetID:=runtime.Str("target-id")
54
54
iftargetID=="" {
55
-
returncommon.FlagErrorf("--target-id is required")
55
+
returnerrs.NewValidationError(errs.SubtypeInvalidArgument, "--target-id is required").WithParam("--target-id")
0 commit comments