mirror of
https://github.com/MontFerret/ferret.git
synced 2025-07-03 00:46:51 +02:00
* Added support of pre-compiled eval expressions * Added unit tests for eval.Function * Added RemoteType and RemoteObjectType enums * Refactored function generation * Refactored Document and Element loading logic * Removed redundant fields from cdp.Page * Exposed eval.Runtime to external callers * Added new eval.RemoteValue interface
28 lines
499 B
Go
28 lines
499 B
Go
package eval
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/mafredri/cdp/protocol/runtime"
|
|
|
|
"github.com/MontFerret/ferret/pkg/drivers"
|
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
|
)
|
|
|
|
func parseRuntimeException(details *runtime.ExceptionDetails) error {
|
|
if details == nil || details.Exception == nil {
|
|
return nil
|
|
}
|
|
|
|
desc := *details.Exception.Description
|
|
|
|
if strings.Contains(desc, drivers.ErrNotFound.Error()) {
|
|
return drivers.ErrNotFound
|
|
}
|
|
|
|
return core.Error(
|
|
core.ErrUnexpected,
|
|
desc,
|
|
)
|
|
}
|