Some requests to piston fail.
Closed this issue · 0 comments
Jonxslays commented
Error:
Err(reqwest::Error { kind: Decode, source: Error("invalid type: null, expected isize", line: 1, column: 10132) })
Only happens on certain requests.
Reproduction code:
use piston_rs;
#[tokio::main]
async fn main() {
let client = piston_rs::Client::new();
let file = piston_rs::File::default()
.set_content("for i in range(10_000):\n\tprint(i)");
let executor = piston_rs::Executor::new()
.set_language("python")
.add_file(file);
match client.execute(&executor).await {
Ok(response) => {
if let Some(c) = response.compile {
println!("Compilation:\n\n{}", c.output);
}
println!("Output:\n\n{}", response.run.output);
}
Err(e) => {
println!("Something went wrong contacting Piston.");
println!("{}", e);
}
}
}