Use custom error in test.