pr278: Review fixes
This commit is contained in:
parent
39a990364d
commit
e3104688a6
3 changed files with 6 additions and 6 deletions
|
|
@ -172,7 +172,7 @@ func run(ctx context.Context, ms *xmain.State) (err error) {
|
||||||
_, written, err := compile(ctx, ms, plugin, *themeFlag, inputPath, outputPath, *bundleFlag, pw.Page)
|
_, written, err := compile(ctx, ms, plugin, *themeFlag, inputPath, outputPath, *bundleFlag, pw.Page)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if written {
|
if written {
|
||||||
return fmt.Errorf("failed to compile (partial render written): %w", err)
|
return fmt.Errorf("failed to fully compile (partial render written): %w", err)
|
||||||
}
|
}
|
||||||
return fmt.Errorf("failed to compile: %w", err)
|
return fmt.Errorf("failed to compile: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -346,11 +346,11 @@ func (w *watcher) compileLoop(ctx context.Context) error {
|
||||||
w.pw = newPW
|
w.pw = newPW
|
||||||
}
|
}
|
||||||
|
|
||||||
b, _, err := compile(ctx, w.ms, w.layoutPlugin, w.themeID, w.inputPath, w.outputPath, w.bundle, w.pw.Page)
|
svg, _, err := compile(ctx, w.ms, w.layoutPlugin, w.themeID, w.inputPath, w.outputPath, w.bundle, w.pw.Page)
|
||||||
errs := ""
|
errs := ""
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if len(b) > 0 {
|
if len(svg) > 0 {
|
||||||
err = fmt.Errorf("failed to %scompile (rendering partial svg): %w", recompiledPrefix, err)
|
err = fmt.Errorf("failed to fully %scompile (rendering partial svg): %w", recompiledPrefix, err)
|
||||||
} else {
|
} else {
|
||||||
err = fmt.Errorf("failed to %scompile: %w", recompiledPrefix, err)
|
err = fmt.Errorf("failed to %scompile: %w", recompiledPrefix, err)
|
||||||
}
|
}
|
||||||
|
|
@ -360,7 +360,7 @@ func (w *watcher) compileLoop(ctx context.Context) error {
|
||||||
w.ms.Log.Success.Printf("successfully %scompiled %v to %v", recompiledPrefix, w.inputPath, w.outputPath)
|
w.ms.Log.Success.Printf("successfully %scompiled %v to %v", recompiledPrefix, w.inputPath, w.outputPath)
|
||||||
}
|
}
|
||||||
w.broadcast(&compileResult{
|
w.broadcast(&compileResult{
|
||||||
SVG: string(b),
|
SVG: string(svg),
|
||||||
Err: errs,
|
Err: errs,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ func runWorkers(ctx context.Context, ms *xmain.State, svg []byte, imgs [][][]byt
|
||||||
|
|
||||||
bundledImage, err := worker(ctx, img[1], isRemote)
|
bundledImage, err := worker(ctx, img[1], isRemote)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ms.Log.Error.Printf("failed to bundle %s: %v", img[0], err)
|
ms.Log.Error.Printf("failed to bundle %s: %v", img[1], err)
|
||||||
errhrefsMu.Lock()
|
errhrefsMu.Lock()
|
||||||
errhrefs = append(errhrefs, string(img[1]))
|
errhrefs = append(errhrefs, string(img[1]))
|
||||||
errhrefsMu.Unlock()
|
errhrefsMu.Unlock()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue