From 1d1bf2477368a01b3a70c61b6d02da97127a6258 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 25 Sep 2023 15:20:17 -0700 Subject: [PATCH] include input path name in failure msg --- d2cli/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d2cli/main.go b/d2cli/main.go index 546a5a977..56aed09e9 100644 --- a/d2cli/main.go +++ b/d2cli/main.go @@ -334,9 +334,9 @@ func Run(ctx context.Context, ms *xmain.State) (err error) { _, written, err := compile(ctx, ms, plugins, layoutFlag, renderOpts, fontFamily, *animateIntervalFlag, inputPath, outputPath, "", *bundleFlag, *forceAppendixFlag, pw.Page) if err != nil { if written { - return fmt.Errorf("failed to fully compile (partial render written): %w", err) + return fmt.Errorf("failed to fully compile (partial render written) %s: %w", ms.HumanPath(inputPath), err) } - return fmt.Errorf("failed to compile: %w", err) + return fmt.Errorf("failed to compile %s: %w", ms.HumanPath(inputPath), err) } return nil }