(v interface{}, opts encOpts)
| 295 | type jsonError struct{ error } |
| 296 | |
| 297 | func (e *encodeState) marshal(v interface{}, opts encOpts) (err error) { |
| 298 | defer func() { |
| 299 | if r := recover(); r != nil { |
| 300 | if je, ok := r.(jsonError); ok { |
| 301 | err = je.error |
| 302 | } else { |
| 303 | panic(r) |
| 304 | } |
| 305 | } |
| 306 | }() |
| 307 | e.reflectValue(reflect.ValueOf(v), opts) |
| 308 | return nil |
| 309 | } |
| 310 | |
| 311 | // error aborts the encoding by panicking with err wrapped in jsonError. |
| 312 | func (e *encodeState) error(err error) { |
no test coverage detected