@@ -17,31 +17,6 @@ type paramUnion = param.APIUnion
1717// aliased to make [param.APIObject] private when embedding
1818type paramObj = param.APIObject
1919
20- type Error struct {
21- // Application-specific error code (machine-readable)
22- Code string `json:"code,required"`
23- // Human-readable error description for debugging
24- Message string `json:"message,required"`
25- // Additional error details (for multiple errors)
26- Details []ErrorDetail `json:"details"`
27- InnerError ErrorDetail `json:"inner_error"`
28- // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
29- JSON struct {
30- Code respjson.Field
31- Message respjson.Field
32- Details respjson.Field
33- InnerError respjson.Field
34- ExtraFields map [string ]respjson.Field
35- raw string
36- } `json:"-"`
37- }
38-
39- // Returns the unmodified JSON received from the API
40- func (r Error ) RawJSON () string { return r .JSON .raw }
41- func (r * Error ) UnmarshalJSON (data []byte ) error {
42- return apijson .UnmarshalRoot (data , r )
43- }
44-
4520type ErrorDetail struct {
4621 // Lower-level error code providing more specific detail
4722 Code string `json:"code"`
@@ -64,7 +39,7 @@ func (r *ErrorDetail) UnmarshalJSON(data []byte) error {
6439
6540// An error event from the application.
6641type ErrorEvent struct {
67- Error Error `json:"error,required"`
42+ Error ErrorEventError `json:"error,required"`
6843 // Event type identifier (always "error").
6944 Event constant.Error `json:"event,required"`
7045 // Time the error occurred.
@@ -87,6 +62,31 @@ func (r *ErrorEvent) UnmarshalJSON(data []byte) error {
8762
8863func (ErrorEvent ) ImplInvocationFollowResponseUnion () {}
8964
65+ type ErrorEventError struct {
66+ // Application-specific error code (machine-readable)
67+ Code string `json:"code,required"`
68+ // Human-readable error description for debugging
69+ Message string `json:"message,required"`
70+ // Additional error details (for multiple errors)
71+ Details []ErrorDetail `json:"details"`
72+ InnerError ErrorDetail `json:"inner_error"`
73+ // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
74+ JSON struct {
75+ Code respjson.Field
76+ Message respjson.Field
77+ Details respjson.Field
78+ InnerError respjson.Field
79+ ExtraFields map [string ]respjson.Field
80+ raw string
81+ } `json:"-"`
82+ }
83+
84+ // Returns the unmodified JSON received from the API
85+ func (r ErrorEventError ) RawJSON () string { return r .JSON .raw }
86+ func (r * ErrorEventError ) UnmarshalJSON (data []byte ) error {
87+ return apijson .UnmarshalRoot (data , r )
88+ }
89+
9090// A log entry from the application.
9191type LogEvent struct {
9292 // Event type identifier (always "log").
0 commit comments