Merge pull request #1617 from alixander/name-failed

cli: include input path name in failure msg
This commit is contained in:
Alexander Wang 2023-09-25 15:32:35 -07:00 committed by GitHub
commit f26e9bd3e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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 ⛑️

View file

@ -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
}