[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r11799 - in branches/locking/subversion: include libsvn_fs

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2004-11-09 21:13:49 CET

On Tue, 9 Nov 2004 sussman@tigris.org wrote:

> Author: sussman
> Date: Tue Nov 9 13:27:28 2004
> New Revision: 11799
>
> Added: branches/locking/subversion/libsvn_fs/access.c
> Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_fs/access.c?view=auto&rev=11799
> ==============================================================================
> --- (empty file)
> +++ branches/locking/subversion/libsvn_fs/access.c Tue Nov 9 13:27:28 2004
> @@ -0,0 +1,92 @@
> +svn_error_t *
> +svn_fs_access_get_username (const char **username,
> + svn_fs_access_t *access_ctx)
> +{
> + if (access_ctx)
> + *username = access_ctx->username;
> + else
> + return svn_error_create (SVN_ERR_FS_NO_USER, 0, "Access context is NULL.");
> +
Do we usually check precoditions like this? I don't say it is bad, just
don't see it in other places. For example, we don't check in all svn_fs
functions that fs is non-NULL, do we?

Would it make sense to have a special error code for API vilations like
this? This is a kind of internal error to the application.

In any case:
- You should encapsulate the error message in _() if it is going to be
  seen by the user.
- No period at end of error message.

> +
> +svn_error_t *
> +svn_fs_access_add_lock_token (svn_fs_access_t *access_ctx,
> + const svn_lock_token_t *token)
> +{
> + if (! access_ctx)
> + return svn_error_create (SVN_ERR_FS_NO_USER, 0,
> + "Access context is NULL.");
> + if (! token)
> + return svn_error_create (SVN_ERR_FS_BAD_LOCK_TOKEN, 0,
> + "Lock token is NULL.");
> +
Same here.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 9 21:49:10 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.