// Test creation and checking. func TestIsError(t *testing.T) { assert := asserts.NewTestingAssertion(t, true) ec := 42 messages := errors.Messages{ec: "test error %d"} err := errors.New(ec, messages, 1) assert.ErrorMatch(err, `\[ERRORS_TEST:042\] test error 1`) assert.True(errors.IsError(err, ec)) assert.False(errors.IsError(err, 0)) err = testError("test error 2") assert.ErrorMatch(err, "test error 2") assert.False(errors.IsError(err, ec)) assert.False(errors.IsError(err, 0)) }
// IsDynamicStatusNotExistsError returns true, if the error signals that // a wanted dynamic status cannot be retrieved because it doesn't exists. func IsDynamicStatusNotExistsError(err error) bool { return errors.IsError(err, ErrDynamicStatusNotExists) }
// IsStaySetVariableNotExistsError returns true, if the error signals that // a wanted stay-set variable cannot be retrieved because it doesn't exists. func IsStaySetVariableNotExistsError(err error) bool { return errors.IsError(err, ErrStaySetVariableNotExists) }
// IsMeasuringPointNotExistsError returns true, if the error signals that // a wanted measuring point cannot be retrieved because it doesn't exists. func IsMeasuringPointNotExistsError(err error) bool { return errors.IsError(err, ErrMeasuringPointNotExists) }
// IsMonitorCannotBeRecoveredError returns true, if the error signals that // the monitor backend has panicked to often and cannot be recovered. func IsMonitorCannotBeRecoveredError(err error) bool { return errors.IsError(err, ErrMonitorCannotBeRecovered) }
// IsMonitorPanickedError returns true, if the error signals that // the monitor backend panicked. func IsMonitorPanickedError(err error) bool { return errors.IsError(err, ErrMonitorPanicked) }