Finalize inbox artifacts and error protocol

This commit is contained in:
2026-03-19 03:25:06 +08:00
parent c3314cd9cf
commit f315d2330d
22 changed files with 659 additions and 86 deletions
+4 -3
View File
@@ -1,13 +1,14 @@
package inbox
import (
"fmt"
"os"
"ai-workflow-skill/internal/protocol"
)
func resolveBodyValue(body, bodyFile string) (string, error) {
if body != "" && bodyFile != "" {
return "", fmt.Errorf("body and body-file are mutually exclusive")
return "", protocol.InvalidInput("body and body-file are mutually exclusive", nil)
}
if bodyFile == "" {
return body, nil
@@ -15,7 +16,7 @@ func resolveBodyValue(body, bodyFile string) (string, error) {
content, err := os.ReadFile(bodyFile)
if err != nil {
return "", fmt.Errorf("read body file %q: %w", bodyFile, err)
return "", protocol.InvalidInput("failed to read body-file", err)
}
return string(content), nil
}