From 1d1bf2477368a01b3a70c61b6d02da97127a6258 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 25 Sep 2023 15:20:17 -0700 Subject: [PATCH 1/2] 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 546a5a977b..56aed09e9f 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 } From 2be527c873076e1b248a54e5cc9601a30bc57ad0 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 25 Sep 2023 15:21:15 -0700 Subject: [PATCH 2/2] changelog --- ci/release/changelogs/next.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 31a140a588..526024aa02 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -9,6 +9,7 @@ - Latex now includes Mathjax's ASM extension for more powerful Latex functionality [#1544](https://github.com/terrastruct/d2/pull/1544) - `font-color` works on Markdown [#1546](https://github.com/terrastruct/d2/pull/1546) - `font-color` works on arrowheads [#1582](https://github.com/terrastruct/d2/pull/1582) +- CLI failure message includes input path [#1617](https://github.com/terrastruct/d2/pull/1617) #### Bugfixes ⛑️