fix: add involves edge from task to agent:nomos at creation
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

Plus sync vendor directory for Docker build compatibility.
This commit is contained in:
2026-08-11 22:03:12 +02:00
parent 7d6a3320d4
commit febc153b7f
3384 changed files with 945212 additions and 2 deletions

View File

@@ -0,0 +1,75 @@
package errors
import (
"fmt"
"github.com/go-resty/resty/v2"
"github.com/infisical/go-sdk/packages/util"
)
// APIError represents an error response from the API
type APIError struct {
Operation string `json:"operation"`
Method string `json:"method"`
URL string `json:"url"`
StatusCode int `json:"statusCode"`
ErrorMessage string `json:"message,omitempty"`
ReqId string `json:"reqId,omitempty"`
}
func (e *APIError) Error() string {
msg := fmt.Sprintf(
"APIError: %s unsuccessful response [%v %v] [status-code=%v] [reqId=%v]",
e.Operation,
e.Method,
e.URL,
e.StatusCode,
e.ReqId,
)
if e.ErrorMessage != "" {
return fmt.Sprintf("%s [message=\"%s\"]", msg, e.ErrorMessage)
}
return msg
}
func NewAPIError(operation string, res *resty.Response) error {
return &APIError{
Operation: operation,
Method: res.Request.Method,
URL: res.Request.URL,
StatusCode: res.StatusCode(),
}
}
func NewAPIErrorWithResponse(operation string, res *resty.Response) error {
errorMessage := util.TryParseErrorBody(res)
reqId := util.TryExtractReqId(res)
return &APIError{
Operation: operation,
Method: res.Request.Method,
URL: res.Request.URL,
StatusCode: res.StatusCode(),
ErrorMessage: errorMessage,
ReqId: reqId,
}
}
// NotModifiedError is returned when the server responds with 304 Not Modified,
// indicating the resource has not changed since the last request (based on ETag).
type NotModifiedError struct {
Operation string
}
func (e *NotModifiedError) Error() string {
return fmt.Sprintf("%s: secrets not modified (HTTP 304)", e.Operation)
}
func NewNotModifiedError(operation string) error {
return &NotModifiedError{
Operation: operation,
}
}

View File

@@ -0,0 +1,22 @@
package errors
import (
"fmt"
)
// RequestError represents an error that occurred during an API request
type RequestError struct {
Operation string `json:"operation"`
error error `json:"-"`
}
func (e *RequestError) Error() string {
return fmt.Sprintf("%s: unable to complete api request [err=%s]", e.Operation, e.error)
}
func NewRequestError(operation string, err error) error {
return &RequestError{
Operation: operation,
error: err,
}
}