Skip to content

Commit

Permalink
Merge pull request envoyproxy#98 from duderino/jblatt_moar_wasm_tests
Browse files Browse the repository at this point in the history
Add test case for sendLocalResponse
  • Loading branch information
duderino authored Aug 16, 2019
2 parents 36e3280 + 8f60be9 commit 0d1a0d4
Show file tree
Hide file tree
Showing 4 changed files with 30,530 additions and 28,168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ class CalloutResponseHandler : public GrpcCallHandler<google::protobuf::Value> {

continueRequest();
}

void onFailure(GrpcStatus status,
std::unique_ptr<WasmData> error_message) override {
request_context_->setEffectiveContext();
logInfo(std::string("failure ") + std::to_string(static_cast<int>(status)) +
std::string(error_message->view()));
" " + std::string(error_message->view()));

service_context_->incrementCalloutFailures();

// TODO wasm engine must support fail closed: expose abortRequest() or similar
continueRequest();
sendLocalResponse(502, error_message->view(), "", {}, status);
}

private:
Expand Down
Binary file not shown.
Loading

0 comments on commit 0d1a0d4

Please sign in to comment.