Commit 95c0fb6
Report write errors in glean-encode-scip2 instead of swallowing them
Summary:
`GleanJSONOutput::write` takes its writer by value and never flushes it, so the
`BufWriter` created in `build_json` is drained only by `Drop`, which discards
the error. A failing final write is therefore invisible and the tool exits 0
after logging `Wrote 1 file (N GiB)`. `std::fs::metadata(...).unwrap_or(0)` hid
a failing `stat` the same way.
Add an explicit `w.flush()?`, and propagate the `metadata` error.
Reviewed By: echistyakov
Differential Revision: D115445577
fbshipit-source-id: 2aefac56591c9c6e5ff3084b9123d22611c0c85b1 parent 857211c commit 95c0fb6
2 files changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
546 | 550 | | |
547 | 551 | | |
548 | 552 | | |
0 commit comments