Skip to content

Commit 2c0d146

Browse files
authored
[receiver/journald] use ErrorIs in assertion (open-telemetry#43905)
Ensure the returned error includes signal not supported. Signed-off-by: alex boten <[email protected]>
1 parent 7de547d commit 2c0d146

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

receiver/journaldreceiver/factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestCreateAndShutdown(t *testing.T) {
4646
assert.NoError(t, receiver.Shutdown(ctx))
4747
} else {
4848
assert.Error(t, err)
49-
assert.IsType(t, pipeline.ErrSignalNotSupported, err)
49+
assert.ErrorIs(t, err, pipeline.ErrSignalNotSupported)
5050
assert.Nil(t, receiver)
5151
}
5252
}

receiver/journaldreceiver/journald_nonlinux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
"go.opentelemetry.io/collector/component"
1313
"go.opentelemetry.io/collector/consumer"
14+
"go.opentelemetry.io/collector/pipeline"
1415
"go.opentelemetry.io/collector/receiver"
1516

1617
"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter"
@@ -33,5 +34,5 @@ func createLogsReceiver(
3334
_ component.Config,
3435
_ consumer.Logs,
3536
) (receiver.Logs, error) {
36-
return nil, errors.New("journald is only supported on linux")
37+
return nil, errors.Join(errors.New("journald is only supported on linux"), pipeline.ErrSignalNotSupported)
3738
}

0 commit comments

Comments
 (0)