Server: Change Invalid Schema from Server Error (500) to User Error (400) (#17572)

* Make invalid schema a user error (400)

* Move invalid_argument exception handler to ex_wrapper

* Fix test

* Simplify test back to original pattern
This commit is contained in:
Chad Voegele 2025-12-02 10:33:50 -06:00 committed by GitHub
parent e148380c7c
commit c4357dcc35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 44 additions and 38 deletions

View file

@ -1375,7 +1375,7 @@ int main() {
try {
tc.verify(json_schema_to_grammar(nlohmann::ordered_json::parse(tc.schema), true));
tc.verify_status(SUCCESS);
} catch (const std::runtime_error & ex) {
} catch (const std::invalid_argument & ex) {
fprintf(stderr, "Error: %s\n", ex.what());
tc.verify_status(FAILURE);
}