Replace raise with expect.