Bug 1332796: Raise correct error