On 07/12/10 06:16 PM, Brock Pytlik wrote:
On 07/ 8/10 05:48 PM, Shawn Walker wrote:
...

line 1794: this needs exception handling

So you're worried about the case where 4 lines before, I could create a
file but now I can't remove it? Ok. Would you prefer the Environment
error on removal to surface and hide that there was a file format error
or should the failure to remove the file be hidden and that the file was
in a bad format be shown to the user?

In general, environment errors shouldn't re-surface to callers if they are EROFS, EACCES, or EPERM (they should be re-raised as the appropriate ApiException). If it's a file format error that should be re-raised as a custom API exception as well. If it's an EnvironmentError that we don't have an equivalent API exception for, then for the moemnt simply raising it is best.

Yes, it's unlikely that a file we just created might fail removal, but possible especially over NFS, etc.

line 1811: this needs exception handling

Again, so in this situation, I was able to create all the files and
directories I needed, but I couldn't create a symlink? Ok. I've added
something to catch a permissions error and raise the api version of
that. Are there other error conditions you're concerned about?

Just EROFS, EACCES, and EPERM. As above, some of these cases are less likely to happen in a local environment, but more likely over NFS or other scenarios.

Cheers,
-SHawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to