mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-01-18 10:36:23 +00:00
Fix exposing full JS codec error.
In some cases tests would fail (I assume based on load / running concurrent tests) without the full JS codec error. Fixes #440.
This commit is contained in:
parent
6b9f7a9ea1
commit
c0b148fecb
@ -59,7 +59,10 @@ pub async fn decode(
|
||||
"#,
|
||||
)
|
||||
.context("Declare script")?;
|
||||
let (buff, buff_promise) = buff.eval().context("Evalulate script")?;
|
||||
let (buff, buff_promise) = buff
|
||||
.eval()
|
||||
.catch(&ctx)
|
||||
.map_err(|e| anyhow!("JS error: {}", e))?;
|
||||
buff_promise.finish()?;
|
||||
let buff: rquickjs::Function = buff.get("Buffer")?;
|
||||
|
||||
@ -147,7 +150,10 @@ pub async fn encode(
|
||||
"#,
|
||||
)
|
||||
.context("Declare script")?;
|
||||
let (buff, buff_promise) = buff.eval().context("Evaluate script")?;
|
||||
let (buff, buff_promise) = buff
|
||||
.eval()
|
||||
.catch(&ctx)
|
||||
.map_err(|e| anyhow!("JS error: {}", e))?;
|
||||
buff_promise.finish()?;
|
||||
let buff: rquickjs::Function = buff.get("Buffer")?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user