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
6 changed files with 44 additions and 38 deletions
+1 -1
View File
@@ -974,7 +974,7 @@ public:
void check_errors() {
if (!_errors.empty()) {
throw std::runtime_error("JSON schema conversion failed:\n" + string_join(_errors, "\n"));
throw std::invalid_argument("JSON schema conversion failed:\n" + string_join(_errors, "\n"));
}
if (!_warnings.empty()) {
fprintf(stderr, "WARNING: JSON schema conversion was incomplete: %s\n", string_join(_warnings, "; ").c_str());