2019-06-19 17:58:56 -04:00
|
|
|
package eval
|
|
|
|
|
|
|
|
import (
|
2021-09-02 11:09:48 -04:00
|
|
|
"strings"
|
2019-06-19 17:58:56 -04:00
|
|
|
|
2020-11-23 20:12:04 -05:00
|
|
|
"github.com/mafredri/cdp/protocol/runtime"
|
|
|
|
|
2021-09-02 11:09:48 -04:00
|
|
|
"github.com/MontFerret/ferret/pkg/drivers"
|
2019-06-19 17:58:56 -04:00
|
|
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
|
|
|
)
|
|
|
|
|
2021-09-02 11:09:48 -04:00
|
|
|
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,
|
|
|
|
)
|
|
|
|
}
|