44package nexus
55
66import (
7- "errors"
87 "fmt"
98 "mime"
109 "net/url"
@@ -46,7 +45,11 @@ func NewOperationFailedError(message string) *OperationError {
4645 State : OperationStateFailed ,
4746 Message : message ,
4847 // Also setting Cause as a temporary workaround for compatibility with older servers.
49- Cause : errors .New (message ),
48+ Cause : & FailureError {
49+ Failure : Failure {
50+ Message : message ,
51+ },
52+ },
5053 }
5154}
5255
@@ -57,7 +60,11 @@ func OperationFailedErrorf(format string, args ...any) *OperationError {
5760 State : OperationStateFailed ,
5861 Message : fmt .Sprintf (format , args ... ),
5962 // Also setting Cause as a temporary workaround for compatibility with older servers.
60- Cause : fmt .Errorf (format , args ... ),
63+ Cause : & FailureError {
64+ Failure : Failure {
65+ Message : fmt .Sprintf (format , args ... ),
66+ },
67+ },
6168 }
6269}
6370
@@ -68,7 +75,11 @@ func NewOperationCanceledError(message string) *OperationError {
6875 State : OperationStateCanceled ,
6976 Message : message ,
7077 // Also setting Cause as a temporary workaround for compatibility with older servers.
71- Cause : errors .New (message ),
78+ Cause : & FailureError {
79+ Failure : Failure {
80+ Message : message ,
81+ },
82+ },
7283 }
7384}
7485
@@ -79,7 +90,11 @@ func OperationCanceledErrorf(format string, args ...any) *OperationError {
7990 State : OperationStateCanceled ,
8091 Message : fmt .Sprintf (format , args ... ),
8192 // Also setting Cause as a temporary workaround for compatibility with older servers.
82- Cause : fmt .Errorf (format , args ... ),
93+ Cause : & FailureError {
94+ Failure : Failure {
95+ Message : fmt .Sprintf (format , args ... ),
96+ },
97+ },
8398 }
8499}
85100
@@ -89,7 +104,11 @@ func OperationErrorf(state OperationState, format string, args ...any) *Operatio
89104 State : state ,
90105 Message : fmt .Sprintf (format , args ... ),
91106 // Also setting Cause as a temporary workaround for compatibility with older servers.
92- Cause : fmt .Errorf (format , args ... ),
107+ Cause : & FailureError {
108+ Failure : Failure {
109+ Message : fmt .Sprintf (format , args ... ),
110+ },
111+ },
93112 }
94113}
95114
@@ -190,7 +209,11 @@ func HandlerErrorf(typ HandlerErrorType, format string, args ...any) *HandlerErr
190209 Type : typ ,
191210 Message : fmt .Sprintf (format , args ... ),
192211 // Also setting Cause as a temporary workaround for compatibility with older servers.
193- Cause : fmt .Errorf (format , args ... ),
212+ Cause : & FailureError {
213+ Failure : Failure {
214+ Message : fmt .Sprintf (format , args ... ),
215+ },
216+ },
194217 }
195218}
196219
0 commit comments