Skip to content

Commit 188bfd4

Browse files
committed
log taskids and failed prompts
1 parent 5e513c3 commit 188bfd4

File tree

3 files changed

+36
-27
lines changed

3 files changed

+36
-27
lines changed

core/src/cli/commands/coordinator/serve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl DriaOracle {
2828
Ok(None) => {
2929
log::info!("Task {} ignored.", task_id)
3030
}
31-
Err(e) => log::error!("Could not process task: {:?}", e),
31+
Err(e) => log::error!("Could not process task {}: {:?}", task_id, e),
3232
}
3333

3434
Ok(())
@@ -41,7 +41,7 @@ impl DriaOracle {
4141
};
4242

4343
if let Err(err) = handle_request(self, status, event.taskId, event.protocol).await {
44-
log::error!("Could not process task: {:?}", err);
44+
log::error!("Could not process task {}: {:?}", event.taskId, err);
4545
}
4646
}
4747

core/src/compute/generation/postprocess/swan.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ impl PostProcess for SwanPurchasePostProcessor {
4343
.map(|end| input[start..start + end].to_string())
4444
})
4545
.ok_or_else(|| {
46-
eyre::eyre!("could not find {} ~ {}", self.start_marker, self.end_marker)
46+
eyre::eyre!(
47+
"could not find {} ~ {} in result: {}",
48+
input,
49+
self.start_marker,
50+
self.end_marker
51+
)
4752
})?;
4853

4954
// collect the chosen addresses

misc/arweave.js

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,34 @@
1717
* Can be piped to `pbcopy` on macOS to copy the output to clipboard.
1818
*/
1919

20-
// parse input
21-
let input = process.argv[2];
22-
if (!input) {
23-
console.error("No input provided.");
24-
return;
25-
}
20+
async function main() {
21+
// parse input
22+
let input = process.argv[2];
23+
if (!input) {
24+
console.error("No input provided.");
25+
return;
26+
}
27+
28+
let arweaveTxId;
29+
if (input.startsWith("0x")) {
30+
// if it starts with 0x, we assume its all hex
31+
arweaveTxId = JSON.parse(
32+
Buffer.from(input.slice(2), "hex").toString()
33+
).arweave;
34+
} else if (input.startsWith("{")) {
35+
// if it starts with {, we assume its a JSON string
36+
console.log("input", input);
37+
arweaveTxId = JSON.parse(input).arweave;
38+
} else {
39+
// otherwise, we assume its a base64 txid
40+
arweaveTxId = input;
41+
}
2642

27-
let arweaveTxId;
28-
if (input.startsWith("0x")) {
29-
// if it starts with 0x, we assume its all hex
30-
arweaveTxId = JSON.parse(
31-
Buffer.from(input.slice(2), "hex").toString()
32-
).arweave;
33-
} else if (input.startsWith("{")) {
34-
// if it starts with {, we assume its a JSON string
35-
console.log("input", input);
36-
arweaveTxId = JSON.parse(input).arweave;
37-
} else {
38-
// otherwise, we assume its a base64 txid
39-
arweaveTxId = input;
43+
// construct the URL
44+
// download the actual response from Arweave
45+
const url = `https://arweave.net/${arweaveTxId}`;
46+
const res = await fetch(url);
47+
console.log(await res.text());
4048
}
4149

42-
// construct the URL
43-
// download the actual response from Arweave
44-
const url = `https://arweave.net/${arweaveTxId}`;
45-
const res = await fetch(url);
46-
console.log(await res.text());
50+
main().catch(console.error);

0 commit comments

Comments
 (0)