Example #1
0
func (s *MySuite) TestWrappedError(c *C) {
	_, e := os.Stat("this-file-cannot-exit")
	es := probe.NewError(e) // *probe.Error
	e = probe.WrapError(es) // *probe.WrappedError
	_, ok := probe.UnwrapError(e)
	c.Assert(ok, Equals, true)
}
Example #2
0
// Do - make a http connection
func (r rpcRequest) Do() (*http.Response, *probe.Error) {
	resp, err := r.transport.RoundTrip(r.req)
	if err != nil {
		if err, ok := probe.UnwrapError(err); ok {
			return nil, err.Trace()
		}
		return nil, probe.NewError(err)
	}
	return resp, nil
}