NewInvalidPathParameterError creates a user-friendly error for invalid path parameters
(paramName, paramValue string)
| 62 | |
| 63 | // NewInvalidPathParameterError creates a user-friendly error for invalid path parameters |
| 64 | func 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 |
| 74 | func NewMissingRequiredFieldError(fieldName string) *ApiError { |
no test coverage detected
searching dependent graphs…