开发者

NSErrorDomain for packaging a HTTP result code?

Ther开发者_高级运维e is NSPOSIXErrorDomain for packaging posix errors, NSOSStatusErrorDomain for packaging Carbon errors, etc, etc.

Is there a standard domain for packaging an HTTP status code as an error?

id error = [NSError errorWithDomain: @"HTTP"
                               code: 404
                           userInfo: theInfo];

I know I could create my own error domain constant just by specifying my own string there, but that seems the wrong way to handle this. Surely there's a domain intended for this specific purpose?


I'm using NSURLErrorDomain for that purpose.


In the interests of closing this, I'm going to just declare that there isn't. If someone knows of a way, feel free to post another answer and I'll select it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜