Skip to content

Commit 2e65724

Browse files
committed
README
1 parent f923d66 commit 2e65724

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,21 @@ The library provides an error builder. Each method can be used standalone (eg: `
253253
The `oops.OopsError` builder must finish with either `.Errorf(...)`, `.Wrap(...)`, `.Wrapf(...)`, `.Join(...)`, `.Recover(...)` or `.Recoverf(...)`.
254254

255255
| Builder method | Getter | Description |
256-
| --------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
256+
|-----------------------------------------|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
257257
| `.With(string, any)` | `err.Context() map[string]any` | Supply a list of attributes key+value. Values of type `func() any {}` are accepted and evaluated lazily. |
258258
| `.WithContext(context.Context, ...any)` | `err.Context() map[string]any` | Supply a list of values declared in context. Values of type `func() any {}` are accepted and evaluated lazily. |
259-
| `.Code(string)` | `err.Code() string` | Set a code or slug that describes the error. Error messages are intented to be read by humans, but such code is expected to be read by machines and be transported over different services |
259+
| `.Code(string)` | `err.Code() string` | Set a code or slug that describes the error. Error messages are intended to be read by humans, but such code is expected to be read by machines and be transported over different services |
260260
| `.Public(string)` | `err.Public() string` | Set a message that is safe to show to an end user |
261261
| `.Time(time.Time)` | `err.Time() time.Time` | Set the error time (default: `time.Now()`) |
262262
| `.Since(time.Time)` | `err.Duration() time.Duration` | Set the error duration |
263263
| `.Duration(time.Duration)` | `err.Duration() time.Duration` | Set the error duration |
264264
| `.In(string)` | `err.Domain() string` | Set the feature category or domain |
265265
| `.Tags(...string)` | `err.Tags() []string` | Add multiple tags, describing the feature returning an error |
266+
| | `err.HasTag(string) bool` | Check whether the error contains provided tag |
266267
| `.Trace(string)` | `err.Trace() string` | Add a transaction id, trace id, correlation id... (default: ULID) |
267268
| `.Span(string)` | `err.Span() string` | Add a span representing a unit of work or operation... (default: ULID) |
268269
| `.Hint(string)` | `err.Hint() string` | Set a hint for faster debugging |
269-
| `.Owner(string)` | `err.Owner() (string)` | Set the name/email of the collegue/team responsible for handling this error. Useful for alerting purpose |
270+
| `.Owner(string)` | `err.Owner() (string)` | Set the name/email of the colleague/team responsible for handling this error. Useful for alerting purpose |
270271
| `.User(string, any...)` | `err.User() (string, map[string]any)` | Supply user id and a chain of key/value |
271272
| `.Tenant(string, any...)` | `err.Tenant() (string, map[string]any)` | Supply tenant id and a chain of key/value |
272273
| `.Request(*http.Request, bool)` | `err.Request() *http.Request` | Supply http request |

oops_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func TestOopsHasTag(t *testing.T) {
186186
is.Error(err)
187187
is.True(err.(OopsError).HasTag("internal"))
188188
is.True(err.(OopsError).HasTag("authz"))
189-
is.False(err.(OopsError).HasTag("not-found")) // Should we fix that?
189+
is.False(err.(OopsError).HasTag("not-found")) // Does not go over all joined errors so far
190190
is.False(err.(OopsError).HasTag("1234"))
191191
}
192192

0 commit comments

Comments
 (0)