Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Change http status code for transaction_exception and eof_exception #4891

Merged
merged 1 commit into from
Jul 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions plugins/http_plugin/http_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,9 @@ namespace eosio {
} catch (chain::tx_duplicate& e) {
error_results results{409, "Conflict", error_results::error_info(e, verbose_http_errors)};
cb( 409, fc::json::to_string( results ));
} catch (chain::transaction_exception& e) {
error_results results{400, "Bad Request", error_results::error_info(e, verbose_http_errors)};
cb( 400, fc::json::to_string( results ));
} catch (fc::eof_exception& e) {
error_results results{400, "Bad Request", error_results::error_info(e, verbose_http_errors)};
cb( 400, fc::json::to_string( results ));
error_results results{422, "Unprocessable Entity", error_results::error_info(e, verbose_http_errors)};
cb( 422, fc::json::to_string( results ));
elog( "Unable to parse arguments to ${api}.${call}", ("api", api_name)( "call", call_name ));
dlog("Bad arguments: ${args}", ("args", body));
} catch (fc::exception& e) {
Expand Down