-
1. Re: Illegal path
alrubinger Feb 15, 2010 12:55 PM (in response to germanescobar)Sure.
PathExistsException extends IllegalArgumentException?
S,
ALR
-
2. Re: Illegal path
aslak Feb 15, 2010 1:12 PM (in response to alrubinger)You have previously added content to something you're trying to define as a Directory. IllegalPathException sounds better to me.
PathExistsException sounds more like something you would get from adding content to the same Path twice, which we now ignore and always let you overwrite. (unless we want to make this over writable as well, remove the illegal path and create the new one)
-
3. Re: Illegal path
alrubinger Feb 15, 2010 1:21 PM (in response to aslak)What's illegal about the path though; that it exists, right? I could even see something extending PathExistsException to a type that denotes (this is already a directory). Whatever we can cook up with is most descriptive/obvious should be good; "IllegalPath" to me begs the question "why is this illegal?"
S,
ALR
-
4. Re: Illegal path
aslak Feb 15, 2010 1:42 PM (in response to alrubinger)Well if you look at Path alone, the reason is that it exists. But it's Illegal because the Asset there can not have sub paths connected to it..
Even tho we split Path and Asset, in this case, and in the ArchiveAsset case, they have a connection..
-
5. Re: Illegal path
alrubinger Feb 15, 2010 1:46 PM (in response to aslak)aslak wrote:
Well if you look at Path alone, the reason is that it exists. But it's Illegal because the Asset there can not have sub paths connected to it..
Right. So how does "IllegalPathException" convey that to the user?
S,
ALR
-
6. Re: Illegal path
aslak Feb 15, 2010 1:53 PM (in response to alrubinger)IllegalPathAssetCombinationException
IllegalSubPathException
?
-
7. Re: Illegal path
germanescobar Feb 15, 2010 1:59 PM (in response to aslak)I'd say that IllegalPathException is self-explanatory and we would also add a message saying why it is illegal. -
8. Re: Illegal path
lightguard Feb 15, 2010 2:04 PM (in response to aslak)ParentPathNotADirectoryException ? Maybe a little too long though.
I think the idea is to have the exception name give as much detail about the error as we can reasonably do so the user has a good idea when looking at a stack trace what the problem is.