mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix(ui): title validation errors correctly instead of Rate Limit Exceeded
The /model/new endpoint returns a 400 validation error (type: validation_error) when 'rpm and tpm must be set to a positive value when enforce_rpm_tpm_on_model_add is enabled in general_settings' but the frontend's titleFor() keyword matcher mistitled it as 'Rate Limit Exceeded' because the message contains 'rpm'/'tpm' substrings, which matched the generic rate-limit keyword check before the more specific validation check could catch it. Add "'enforce_rpm_tpm_on_model_add' is enabled" to VALIDATION_MATCH so this message is classified as a Validation Error, matching the actual HTTP 400 validation_error the backend already returns. A narrow match on the setting name (rather than the generic "must be set when") avoids overriding the status-based classification of unrelated 401s, e.g. the PKCE 'GENERIC_CLIENT_ID must be set when PKCE is enabled' error.
This commit is contained in:
parent
65eae963a7
commit
526fc9eab1
1 changed files with 1 additions and 1 deletions
|
|
@ -104,7 +104,7 @@ const VALIDATION_MATCH = [
|
|||
"invalid file type",
|
||||
"invalid field",
|
||||
"invalid date format",
|
||||
"must be set when",
|
||||
"'enforce_rpm_tpm_on_model_add' is enabled",
|
||||
];
|
||||
|
||||
const NOT_FOUND_MATCH = [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue