(e any)
| 128 | } |
| 129 | |
| 130 | func (v *VM) ThrowError(e any) { |
| 131 | if oe, ok := e.(otto.Value); ok { |
| 132 | panic(oe) |
| 133 | } |
| 134 | if re, ok := e.(err.Error); ok { |
| 135 | panic(v.o.MakeCustomError("Error", fmt.Sprintf("E:%s:%d:%s", re.Name(), re.Code(), re.Error()))) |
| 136 | } |
| 137 | if ee, ok := e.(error); ok { |
| 138 | panic(v.o.MakeCustomError("Error", ee.Error())) |
| 139 | } |
| 140 | panic(v.o.MakeCustomError("Error", fmt.Sprintf("%v", e))) |
| 141 | } |
| 142 | |
| 143 | func ThrowDetachedError(e any) { |
| 144 | message := errorMessage(e) |
no test coverage detected