Process.exitValue and cURL

I'm trying to understand Process.exitValue() here -

X.runShellCommand("curl -f http://www.somewebsite.com/");

With the -f switch, what am I expecting exitValue() to return in case of a 404 error? It seems to me I get 0 no matter what happens. Maybe I'm misunderstanding something entirely here. If anyone can shed some light on this, I'd much appreciate it.

With the -f switch, what am I expecting exitValue() to return in case of a 404 error? It seems to me I get 0 no matter what happens.

Seems reasonable to me. curl successfully processed the command.

Aye, but since I ran it with -f, I would expect it to return 22 on any server error?