开发者

Name a loader error

开发者 https://www.devze.com 2022-12-16 16:12 出处:网络
I wrote a loader class that has a tries property that indicates how many times to retry loading a url if an error code is returned. For instance with Twitter, the loader would retry loading a method c

I wrote a loader class that has a tries property that indicates how many times to retry loading a url if an error code is returned. For instance with Twitter, the loader would retry loading a method call if a fail whale is returned, since the next call would probably return success.

I specify the many errors that can be dispatched with string constants, so there's XMLLoaderError.IO, XMLLoaderError.SECURITY, etc. I'm having trouble thinking of a name for the error dispatched if the number of tries exceeds the tries property. At first, I thought XMLLoaderError.TRIES_EXCEEDED, but I'm certain there's something better out there. I considered XMLLoaderError.TIMEOUT, but timeout is more of a single load e开发者_Go百科rror. Or I can be clever and use XMLLoaderError.TRYOUT (jk) Any ideas?


Since your other errors indicate the type/genre of error that occurred - ie. "SECURITY" or "IO" - and these are within the XMLLoader context, why not just name it TRY? XMLLoaderError.TRY makes sense to me - or actually, XMLLoaderError.RETRIES probably makes even more sense!

0

精彩评论

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

关注公众号