Exemplo n.º 1
0
// 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))
}
Exemplo n.º 2
0
// IsCleanupFaildError returns true, if the error signals the
// failing of a prop error.
func IsCleanupFailedError(err error) bool {
	return errors.IsError(err, ErrCleanupFailed)
}
Exemplo n.º 3
0
// IsWaitedTooLongError returns true, if the error signals a
// timeout when waiting for a signal.
func IsWaitedTooLongError(err error) bool {
	return errors.IsError(err, ErrWaitedTooLong)
}
Exemplo n.º 4
0
// IsPropAlreadyExistError returns true, if the error signals a
// double prop key.
func IsPropAlreadyExistError(err error) bool {
	return errors.IsError(err, ErrPropAlreadyExist)
}
Exemplo n.º 5
0
// IsPropNotFoundError returns true, if the error signals a
// non-existing prop.
func IsPropNotFoundError(err error) bool {
	return errors.IsError(err, ErrPropNotFound)
}
Exemplo n.º 6
0
// IsSceneEndedError returns true, if the error signals that
// the scene isn't active anymore.
func IsSceneEndedError(err error) bool {
	return errors.IsError(err, ErrSceneEnded)
}
Exemplo n.º 7
0
// IsTimeoutError returns true, if the error signals that
// the scene end after an absolute timeout.
func IsTimeoutError(err error) bool {
	return errors.IsError(err, ErrTimeout)
}
Exemplo n.º 8
0
// IsInvalidHexLengthError returns true, if the error signals that
// the passed hex string for a UUID hasn't the correct size of 32.
func IsInvalidHexLengthError(err error) bool {
	return errors.IsError(err, ErrInvalidHexLength)
}
Exemplo n.º 9
0
// IsInvalidHexValueError returns true, if the error signals an
// invalid hex string as input.
func IsInvalidHexValueError(err error) bool {
	return errors.IsError(err, ErrInvalidHexValue)
}
Exemplo n.º 10
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)
}
Exemplo n.º 11
0
// 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)
}
Exemplo n.º 12
0
// 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)
}
Exemplo n.º 13
0
// 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)
}
Exemplo n.º 14
0
// IsMonitorPanickedError returns true, if the error signals that
// the monitor backend panicked.
func IsMonitorPanickedError(err error) bool {
	return errors.IsError(err, ErrMonitorPanicked)
}