From b1474529480fc9c36dedaca8ba640c11c64ad3ab Mon Sep 17 00:00:00 2001 From: Peter Kolloch Date: Mon, 19 Feb 2024 18:18:15 +0700 Subject: feat(tvix/nix-compat): Extend parse errors ...so that we can parse (and at the same time validate) store paths directly to `StorePath`s. https: //b.tvl.fyi/issues/264 Change-Id: Ide4cb5403f8e3400f7d2a5838c652ac35dbd1a4f Reviewed-on: https://cl.tvl.fyi/c/depot/+/10968 Reviewed-by: flokli Autosubmit: Peter Kolloch Tested-by: BuildkiteCI --- tvix/nix-compat/src/derivation/parse_error.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tvix') diff --git a/tvix/nix-compat/src/derivation/parse_error.rs b/tvix/nix-compat/src/derivation/parse_error.rs index 26df13f5772b..68228b07c4bc 100644 --- a/tvix/nix-compat/src/derivation/parse_error.rs +++ b/tvix/nix-compat/src/derivation/parse_error.rs @@ -2,7 +2,7 @@ //! Derivations from ATerm. use nom::IResult; -use crate::nixhash; +use crate::{nixhash, store_path}; pub type NomResult = IResult>; @@ -22,6 +22,9 @@ pub enum ErrorKind { #[error("nix hash error: {0}")] NixHashError(nixhash::Error), + #[error("store path error: {0}")] + StorePathError(#[from] store_path::Error), + #[error("nom error: {0:?}")] Nom(nom::error::ErrorKind), } -- cgit 1.4.1