Skip to content

Commit 9f8f192

Browse files
committed
chore(wasm-executor): add nicer error if you missed a feature flag during compilation
1 parent 8974076 commit 9f8f192

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
### Changed
1313
- [2387](https://github.com/FuelLabs/fuel-core/pull/2387): Update description `tx-max-depth` flag.
1414
- [2630](https://github.com/FuelLabs/fuel-core/pull/2630): Removed some noisy `tracing::info!` logs
15+
- [2653](https://github.com/FuelLabs/fuel-core/pull/2653): Added cleaner error for wasm-executor upon failed deserialization.
1516

1617
### Added
1718
- [2553](https://github.com/FuelLabs/fuel-core/pull/2553): Scaffold global merkle root storage crate.

crates/services/upgradable-executor/src/instance.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,11 @@ impl Instance<InputData> {
636636
.expect("Memory was initialized above; qed");
637637
let slice = &memory.data(&self.store)[ptr..ptr.saturating_add(len)];
638638

639-
postcard::from_bytes(slice).map_err(|e| anyhow::anyhow!(e))
639+
postcard::from_bytes(slice).map_err(|e| {
640+
match e {
641+
postcard::Error::SerdeDeCustom => anyhow::anyhow!(e).context("Error in Deserialization; check feature flags of wasm module during compilation"),
642+
_ => anyhow::anyhow!(e).context("Error in Deserialization; fatal"),
643+
}
644+
})
640645
}
641646
}

0 commit comments

Comments
 (0)