views:

57

answers:

1

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 error. Or I can be clever and use XMLLoaderError.TRYOUT (jk) Any ideas?

A: 

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!

divisionoftigers
I actually renamed `tries` to `retryCount`, so the error followed your suggestion as `XMLLoaderError.RETRY_COUNT`.
destroytoday