MCPcopy
hub / github.com/devtron-labs/devtron / NewInvalidPathParameterError

Function NewInvalidPathParameterError

internal/util/ResourceErrorFactory.go:64–71  ·  view source on GitHub ↗

NewInvalidPathParameterError creates a user-friendly error for invalid path parameters

(paramName, paramValue string)

Source from the content-addressed store, hash-verified

62
63// NewInvalidPathParameterError creates a user-friendly error for invalid path parameters
64func NewInvalidPathParameterError(paramName, paramValue string) *ApiError {
65 return NewApiError(
66 http.StatusBadRequest,
67 fmt.Sprintf("Invalid path parameter '%s'", paramName),
68 fmt.Sprintf("invalid path parameter %s: %s", paramName, paramValue),
69 ).WithCode(constants.InvalidPathParameter).
70 WithUserDetailMessage("Please check the parameter format and try again.")
71}
72
73// NewMissingRequiredFieldError creates a user-friendly error for missing required fields
74func NewMissingRequiredFieldError(fieldName string) *ApiError {

Callers 3

getIntPathParamMethod · 0.92
HandleParameterErrorFunction · 0.92
convertToIntWithContextFunction · 0.92

Calls 3

NewApiErrorFunction · 0.85
WithUserDetailMessageMethod · 0.80
WithCodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…