You've failed because you were not able to achieve your desired outcome. But in that case you're a failure, meaning you basically have failed, even if it was not what you intended to fail. Which could mean you have succeeded. So it can go either way.