Skip to content

Commit cdc8657

Browse files
authored
Add better logging for a few common errors. (#100)
Fixes istio/istio#27637. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
1 parent 44516a7 commit cdc8657

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/wasm.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ bool WasmBase::initialize(const std::string &code, bool allow_precompiled) {
295295
if (started_from_ == Cloneable::NotCloneable) {
296296
auto ok = wasm_vm_->load(code, allow_precompiled);
297297
if (!ok) {
298+
fail(FailState::UnableToInitializeCode, "Failed to load Wasm code");
298299
return false;
299300
}
300301
code_ = code;
@@ -303,6 +304,7 @@ bool WasmBase::initialize(const std::string &code, bool allow_precompiled) {
303304

304305
abi_version_ = wasm_vm_->getAbiVersion();
305306
if (abi_version_ == AbiVersion::Unknown) {
307+
fail(FailState::UnableToInitializeCode, "Missing or unknown Proxy-Wasm ABI version");
306308
return false;
307309
}
308310

0 commit comments

Comments
 (0)