tvl-depot/users/Profpatsch/read-http.nix
Profpatsch 492b79ec7a feat(users/Profpatsch): add die_* helpers for semantic exit errors
There is this semantic exit code schema championed by execline and
skaware tooling, and we refined and documented it a bit in lorri
d1d673d420/src/ops/mod.rs (L24-L35)
in the past.

This just transcribes the error messages into simple helper functions.

Applies the functions to the places where we would panic or die
`sys::exit()` instead.

Change-Id: I15ca05cd6f99a25a3378518be94110eab416354e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2475
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 16:06:25 +00:00

17 lines
530 B
Nix

{ depot, pkgs, ... }:
let
# reads a http request (stdin), and writes all headers to stdout, as netencoded dict
read-http = depot.users.Profpatsch.writers.rustSimple {
name = "read-http";
dependencies = [
depot.users.Profpatsch.rust-crates.ascii
depot.users.Profpatsch.rust-crates.httparse
depot.users.Profpatsch.netencode.netencode-rs
depot.users.Profpatsch.arglib.netencode.rust
depot.users.Profpatsch.execline.exec-helpers
];
} (builtins.readFile ./read-http.rs);
in read-http