Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Aug 4, 2021
2 parents 4111ee9 + 59a82eb commit 53a266d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Added

- Added `ErrorHandlerFunc` to use a function as an `"go.opentelemetry.io/otel".ErrorHandler`. (#2149)

### Changed

### Deprecated
Expand Down
11 changes: 11 additions & 0 deletions error_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@ type ErrorHandler interface {
// DO NOT CHANGE: any modification will not be backwards compatible and
// must never be done outside of a new major release.
}

// ErrorHandlerFunc is a convenience adapter to allow the use of a function
// as an ErrorHandler.
type ErrorHandlerFunc func(error)

var _ ErrorHandler = ErrorHandlerFunc(nil)

// Handle handles the irremediable error by calling the ErrorHandlerFunc itself.
func (f ErrorHandlerFunc) Handle(err error) {
f(err)
}
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ package otel // import "go.opentelemetry.io/otel"

// Version is the current release version of OpenTelemetry in use.
func Version() string {
return "1.0.0-RC1"
return "1.0.0-RC2"
}

0 comments on commit 53a266d

Please sign in to comment.