mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-10 09:32:13 +01:00
`runtime.ExceptionDetails: Uncaught exception at 4:47: SyntaxError: Unexpected token %`
This commit is contained in:
committed by
Julien Neuhart
parent
e6484bb2d5
commit
f9fb97a572
@@ -107,10 +107,13 @@ func (html *HTML) Print(destination string) error {
|
||||
document.fonts.ready.then(function () {
|
||||
resolve('fonts loaded');
|
||||
});
|
||||
setTimeout(resolve.bind(resolve, 'timeout'), %.0f);
|
||||
setTimeout(resolve.bind(resolve, 'timeout'), 500);
|
||||
});`
|
||||
scriptArg := runtime.NewEvaluateArgs(script).SetAwaitPromise(true)
|
||||
returnObj, _ := c.Runtime.Evaluate(html.Context, scriptArg)
|
||||
if returnObj.ExceptionDetails != nil {
|
||||
return fmt.Errorf("script evaluated with exception: %+v", returnObj.ExceptionDetails)
|
||||
}
|
||||
loadFontsResult := string(returnObj.Result.Value)
|
||||
if strings.Contains(loadFontsResult, "timeout") {
|
||||
return errors.New("timed out loading fonts")
|
||||
|
||||
Reference in New Issue
Block a user