1
0
Fork 0

do not use an internal error for JSON parse errors (#7799)

This commit is contained in:
Jan 2018-12-19 12:54:47 +01:00 committed by GitHub
parent 7f4740b335
commit 99809a445e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -462,7 +462,8 @@ void RestHandler::executeEngine(bool isContinue) {
<< DIAGNOSTIC_INFORMATION(ex); << DIAGNOSTIC_INFORMATION(ex);
#endif #endif
RequestStatistics::SET_EXECUTE_ERROR(_statistics); RequestStatistics::SET_EXECUTE_ERROR(_statistics);
bool const isParseError = (ex.errorCode() == arangodb::velocypack::Exception::ParseError); bool const isParseError = (ex.errorCode() == arangodb::velocypack::Exception::ParseError ||
ex.errorCode() == arangodb::velocypack::Exception::UnexpectedControlCharacter);
Exception err(isParseError ? TRI_ERROR_HTTP_CORRUPTED_JSON : TRI_ERROR_INTERNAL, std::string("VPack error: ") + ex.what(), Exception err(isParseError ? TRI_ERROR_HTTP_CORRUPTED_JSON : TRI_ERROR_INTERNAL, std::string("VPack error: ") + ex.what(),
__FILE__, __LINE__); __FILE__, __LINE__);
handleError(err); handleError(err);