You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Oren Eini (Murphy & Associates)" <v-...@microsoft.com> on 2008/03/07 17:16:36 UTC

Custom error messages

Hi,
I am currently in the process of building SvnBridge (http://www.codeplex.com/SvnBridge/), a Subversion front end that talks to a Team System backend.
One of the issues that I have run into was with error reporting. Specifically, when there is an error on my part, I don't seem to have any way to send a human readable message to the user.
The issue seems to be related to the way that errors are handled in SVN. Under some conditions, it will accept the <m:human-readable errorcode="..."> string, but in many cases, it will just ignore it, preferring to show a 500 Internal Server Error instead.
Is there a consistent way to be able to send errors to SVN client and have it display them to the user?

Thanks,
Ayende


RE: Custom error messages

Posted by "Oren Eini (Murphy & Associates)" <v-...@microsoft.com>.
> -----Original Message-----
> From: C. Michael Pilato [mailto:cmpilato@collab.net]
> Sent: Friday, March 07, 2008 10:48 AM
> To: Oren Eini (Murphy & Associates)
> Cc: Karl Fogel; dev@subversion.tigris.org
> Subject: Re: Custom error messages
>
> >
> > I think it belongs here. It is a dev issue, not a usage issue. More
> > specifically, it regards the WebDAV protocol.
>
> Your question is borderline.  It is a dev issue, but is not about the
> development *of* Subversion, which is the topic of this list.  It's a
> question about development *with* or *against* Subversion, which is not
> on-topic here.  However, I don't expect Subversion users would know the
> answer, either, so...

Thanks for the clarification.
I am used to dev lists to include *with* or *against* questions, while users list include usage questions.
Sorry for the mistake.

> Short answer:  no, there is no way to guarantee that.

Oh well, that was worth the shot.



Re: Custom error messages

Posted by "C. Michael Pilato" <cm...@collab.net>.
Oren Eini (Murphy & Associates) wrote:
>>> Is there a consistent way to be able to send errors to SVN client and
>>>  have it display them to the user?
>> This question should probably be asked on users@subversion.tigris.org.
> 
> I think it belongs here. It is a dev issue, not a usage issue. More
> specifically, it regards the WebDAV protocol.

Your question is borderline.  It is a dev issue, but is not about the
development *of* Subversion, which is the topic of this list.  It's a
question about development *with* or *against* Subversion, which is not
on-topic here.  However, I don't expect Subversion users would know the
answer, either, so...

> I am writing SVN Server. One that can use the WebDAV protocol and make
> SVN clients think that they are talking to Subversion repository. My
> question regards to how I can cause a server error message to be shown to
> the user. On certain situations, I can use the error codes and send my
> own message along. The problem is that in other situations (such as a GET
> request), sending an error message back to the client will not show the
> error to the user, but a generic error instead. I want to know if there
> is a way to send an error to SVN clients in such a fashion that it will
> always be displayed.

Short answer:  no, there is no way to guarantee that.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


RE: Custom error messages

Posted by "Oren Eini (Murphy & Associates)" <v-...@microsoft.com>.
> -----Original Message-----
> From: Karl Fogel [mailto:kfogel@red-bean.com]
> Sent: Friday, March 07, 2008 11:00 AM
> To: Oren Eini (Murphy & Associates)
> Cc: dev@subversion.tigris.org
> Subject: Re: Custom error messages
>
>
> > errcode match the standard SVN error codes, and on some cases 16006
> > (revision doesn't exist), the client will display the message from
> the
> > server. In other cases, it appears to use just the errcode number and
> > internal resource for that.
>
> Now this does sound like it might be a bug in the Subversion client, if
> it's behaving differently on receiving the same error (in which case
> this list is, of course, the right place!)  But we'll need a full
> reproduction recipe as described in
>
>    http://subversion.tigris.org/bugs.html
>
> ...if you have time to write one.  Thanks!

The problem is that I don't think that this is a bug.
The usage of the server message is consistent when you are getting certain error messages.
As an example, for errcode 160006 the client will show the error from the server.
For 160024 errcode it will not.
I would assume that this relates to messages that requires parameters or not.
The 160006 is the revision does not exists, and it needs the information from the server.
For 160024, there is no need for additional information from the server, so it probably just use an internal resource instead of using the server message.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


RE: Custom error messages

Posted by "Oren Eini (Murphy & Associates)" <v-...@microsoft.com>.
> -----Original Message-----
> From: C. Michael Pilato [mailto:cmpilato@collab.net]
> Sent: Friday, March 07, 2008 11:09 AM
> To: dev@subversion.tigris.org
> Subject: Re: Custom error messages
>
>
> Karl, I think Oren is saying two things:
>
>     1.  that we use the <D:error> tags in many of our various WebDAV
>         responses, but not all of them.

I have actually never seen the <C:error/> tag used, and my experiments show that in most scenarios, it is discarded.
Then again, I wrote the WebDAV "stack" that I am using, so that may very well be the case.
The part that is usually shown to the user is the text inside <m:human-readable errcode="..."/>

>     2.  that sometimes the client, upon receiving one of those error
>         tags in a WebDAV response, relays the human-readable text in
>         the tag to the user; sometimes it appears to discard it.
>
> As for #2, I don't think the concern is that an error isn't treated as
> an error, but that sometimes that human-readable descriptive text
> doesn't survive the long trip from mod_dav_svn to the user's console.
> Perhaps sometimes the error received from the server gets wrapped by
> another such that the user doesn't see the original error text?  I
> dunno.

Re: Custom error messages

Posted by Karl Fogel <kf...@red-bean.com>.
"C. Michael Pilato" <cm...@collab.net> writes:
> Karl, I think Oren is saying two things:
>
>    1.  that we use the <D:error> tags in many of our various WebDAV
>        responses, but not all of them.
>    2.  that sometimes the client, upon receiving one of those error
>        tags in a WebDAV response, relays the human-readable text in
>        the tag to the user; sometimes it appears to discard it.
>
> I believe that the reason for #1 is that sometimes errors are returned
> to the client not by mod_dav_svn, but by mod_dav (which sits atop
> mod_dav_svn in the architectural diagram and know nothing of
> Subversion-specific errors).
>
> As for #2, I don't think the concern is that an error isn't treated as
> an error, but that sometimes that human-readable descriptive text
> doesn't survive the long trip from mod_dav_svn to the user's console.
> Perhaps sometimes the error received from the server gets wrapped by
> another such that the user doesn't see the original error text?  I
> dunno.

Okay, thanks.  The only scenario I'm worried about is:

   3. Their custom server sends back protocol that is, in all meaningful
      ways, the same as what Subversion's own server would send back,
      yet gets different results on the client.

If #3 is happening, then I'm worried.  If it's #1 or #2, I agree
they're... interesting... but I don't have any special expertise to
offer Oren (though the users@ list might be just as likely to have
answers, or even more likely, since people who write code using the
Subversion APIs hang out there).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Custom error messages

Posted by "C. Michael Pilato" <cm...@collab.net>.
Karl Fogel wrote:
> "Oren Eini (Murphy & Associates)" <v-...@microsoft.com> writes:
>> Errors are sent in this format using DAV:
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <D:error xmlns:D="DAV:" xmlns:m="http://apache.org/dav/xmlns" xmlns:C="svn:">
>> <C:error/>
>> <m:human-readable errcode="160024">
>> The version resource does not correspond to the resource within the transaction.  Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit).
>> </m:human-readable>
>> </D:error>
>>
>> errcode match the standard SVN error codes, and on some cases 16006
>> (revision doesn't exist), the client will display the message from the
>> server. In other cases, it appears to use just the errcode number and
>> internal resource for that.
> 
> Now this does sound like it might be a bug in the Subversion client, if
> it's behaving differently on receiving the same error (in which case
> this list is, of course, the right place!)  But we'll need a full
> reproduction recipe as described in
> 
>    http://subversion.tigris.org/bugs.html
> 
> ...if you have time to write one.  Thanks!

Karl, I think Oren is saying two things:

    1.  that we use the <D:error> tags in many of our various WebDAV
        responses, but not all of them.
    2.  that sometimes the client, upon receiving one of those error
        tags in a WebDAV response, relays the human-readable text in
        the tag to the user; sometimes it appears to discard it.

I believe that the reason for #1 is that sometimes errors are returned to 
the client not by mod_dav_svn, but by mod_dav (which sits atop mod_dav_svn 
in the architectural diagram and know nothing of Subversion-specific errors).

As for #2, I don't think the concern is that an error isn't treated as an 
error, but that sometimes that human-readable descriptive text doesn't 
survive the long trip from mod_dav_svn to the user's console.  Perhaps 
sometimes the error received from the server gets wrapped by another such 
that the user doesn't see the original error text?  I dunno.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: Custom error messages

Posted by Karl Fogel <kf...@red-bean.com>.
"Oren Eini (Murphy & Associates)" <v-...@microsoft.com> writes:
> Errors are sent in this format using DAV:
>
> <?xml version="1.0" encoding="utf-8"?>
> <D:error xmlns:D="DAV:" xmlns:m="http://apache.org/dav/xmlns" xmlns:C="svn:">
> <C:error/>
> <m:human-readable errcode="160024">
> The version resource does not correspond to the resource within the transaction.  Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit).
> </m:human-readable>
> </D:error>
>
> errcode match the standard SVN error codes, and on some cases 16006
> (revision doesn't exist), the client will display the message from the
> server. In other cases, it appears to use just the errcode number and
> internal resource for that.

Now this does sound like it might be a bug in the Subversion client, if
it's behaving differently on receiving the same error (in which case
this list is, of course, the right place!)  But we'll need a full
reproduction recipe as described in

   http://subversion.tigris.org/bugs.html

...if you have time to write one.  Thanks!

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: Custom error messages

Posted by "Oren Eini (Murphy & Associates)" <v-...@microsoft.com>.
> -----Original Message-----
> From: Karl Fogel [mailto:kfogel@red-bean.com]
> Sent: Friday, March 07, 2008 10:53 AM
> To: Oren Eini (Murphy & Associates)
> Cc: dev@subversion.tigris.org
> Subject: Re: Custom error messages
>
> "Oren Eini (Murphy & Associates)" <v-...@microsoft.com> writes:
> > I think it belongs here. It is a dev issue, not a usage issue.
> > More specifically, it regards the WebDAV protocol.
>
> Oh, this list isn't for development in general.  It's for the
> development of Subversion itself -- that is, the code for which the
> Subversion maintainers have consciously taken responsibility.

That is a bit different than what I am used to. I'll not make this mistake again.

> Well, I don't remember everything our server does to get the client to
> displays errors, but have you sniffed the wire protocol for examples?
> See http://subversion.tigris.org/faq.html#net-trace for more.

Yes.
Errors are sent in this format using DAV:

<?xml version="1.0" encoding="utf-8"?>
<D:error xmlns:D="DAV:" xmlns:m="http://apache.org/dav/xmlns" xmlns:C="svn:">
<C:error/>
<m:human-readable errcode="160024">
The version resource does not correspond to the resource within the transaction.  Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit).
</m:human-readable>
</D:error>

errcode match the standard SVN error codes, and on some cases 16006 (revision doesn't exist), the client will display the message from the server. In other cases, it appears to use just the errcode number and internal resource for that.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Custom error messages

Posted by steveking <to...@gmail.com>.
Karl Fogel wrote:
> "Oren Eini (Murphy & Associates)" <v-...@microsoft.com> writes:
>> I think it belongs here. It is a dev issue, not a usage issue.
>> More specifically, it regards the WebDAV protocol.
> 
> Oh, this list isn't for development in general.  It's for the
> development of Subversion itself -- that is, the code for which the
> Subversion maintainers have consciously taken responsibility.
> 
> It's great to see someone else implementing Subversion or WebDAV
> implementations, and we're happy to help... But on the users@ list,
> because it's about the usage of Subversion and/or its APIs, not about
> the development of Subversion.  You are "using" the Subversion and/or
> WebDAV protocols, hence "users@".  If you were talking about a patch to
> Subversion's own code, for example, then dev@ would be the place.

Sorry Karl, that was my fault.
He first asked on the TSVN mailing list for help, and I told him to ask 
here. I thought that the dev list would be more appropriate for this 
than the users list, because from what I understood this would require 
some code change in the svn library to get it right.

Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Custom error messages

Posted by Karl Fogel <kf...@red-bean.com>.
Stefan Küng <to...@gmail.com> writes:
> Sorry Karl, that was my fault.
> He first asked on the TSVN mailing list for help, and I told him to
> ask here. I thought that the dev list would be more appropriate for
> this than the users list, because from what I understood this would
> require some code change in the svn library to get it right.

Oh, it's a reasonable thought, don't worry about it.  (For all I know,
you might end up being right about that...)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Custom error messages

Posted by Stefan Küng <to...@gmail.com>.
Karl Fogel wrote:
> "Oren Eini (Murphy & Associates)" <v-...@microsoft.com> writes:
>> I think it belongs here. It is a dev issue, not a usage issue.
>> More specifically, it regards the WebDAV protocol.
> 
> Oh, this list isn't for development in general.  It's for the
> development of Subversion itself -- that is, the code for which the
> Subversion maintainers have consciously taken responsibility.
> 
> It's great to see someone else implementing Subversion or WebDAV
> implementations, and we're happy to help... But on the users@ list,
> because it's about the usage of Subversion and/or its APIs, not about
> the development of Subversion.  You are "using" the Subversion and/or
> WebDAV protocols, hence "users@".  If you were talking about a patch to
> Subversion's own code, for example, then dev@ would be the place.

Sorry Karl, that was my fault.
He first asked on the TSVN mailing list for help, and I told him to ask 
here. I thought that the dev list would be more appropriate for this 
than the users list, because from what I understood this would require 
some code change in the svn library to get it right.

Stefan


-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net


Re: Custom error messages

Posted by Karl Fogel <kf...@red-bean.com>.
"Oren Eini (Murphy & Associates)" <v-...@microsoft.com> writes:
> I think it belongs here. It is a dev issue, not a usage issue.
> More specifically, it regards the WebDAV protocol.

Oh, this list isn't for development in general.  It's for the
development of Subversion itself -- that is, the code for which the
Subversion maintainers have consciously taken responsibility.

It's great to see someone else implementing Subversion or WebDAV
implementations, and we're happy to help... But on the users@ list,
because it's about the usage of Subversion and/or its APIs, not about
the development of Subversion.  You are "using" the Subversion and/or
WebDAV protocols, hence "users@".  If you were talking about a patch to
Subversion's own code, for example, then dev@ would be the place.

> Okay, more explanation.
> I am writing SVN Server. One that can use the WebDAV protocol and make
> SVN clients think that they are talking to Subversion repository.
> My question regards to how I can cause a server error message to be
> shown to the user.
> On certain situations, I can use the error codes and send my own
> message along. The problem is that in other situations (such as a GET
> request), sending an error message back to the client will not show
> the error to the user, but a generic error instead.
> I want to know if there is a way to send an error to SVN clients in
> such a fashion that it will always be displayed.

Well, I don't remember everything our server does to get the client to
displays errors, but have you sniffed the wire protocol for examples?
See http://subversion.tigris.org/faq.html#net-trace for more.

Best,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: Custom error messages

Posted by "Oren Eini (Murphy & Associates)" <v-...@microsoft.com>.
> From: Karl Fogel [mailto:kfogel@red-bean.com]
> Sent: Friday, March 07, 2008 9:38 AM
> To: Oren Eini (Murphy & Associates)
> Cc: dev@subversion.tigris.org
> Subject: Re: Custom error messages
>
> > Is there a consistent way to be able to send errors to SVN client and
> > have it display them to the user?
>
> This question should probably be asked on users@subversion.tigris.org.

I think it belongs here. It is a dev issue, not a usage issue.
More specifically, it regards the WebDAV protocol.

> When you post there, you might want to clarify whether you're talking
> about errors from repository hook scripts, or something else.  I
> couldn't quite grasp what your question was asking: Subversion
> generates
> errors, but it doesn't "accept" them, so I wasn't sure what you meant
> or
> what you're trying to do.

Okay, more explanation.
I am writing SVN Server. One that can use the WebDAV protocol and make SVN clients think that they are talking to Subversion repository.
My question regards to how I can cause a server error message to be shown to the user.
On certain situations, I can use the error codes and send my own message along. The problem is that in other situations (such as a GET request), sending an error message back to the client will not show the error to the user, but a generic error instead.
I want to know if there is a way to send an error to SVN clients in such a fashion that it will always be displayed.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: Custom error messages

Posted by Karl Fogel <kf...@red-bean.com>.
"Oren Eini (Murphy & Associates)" <v-...@microsoft.com> writes:
> I am currently in the process of building SvnBridge
> (http://www.codeplex.com/ SvnBridge/), a Subversion front end that
> talks to a Team System backend.
>
> One of the issues that I have run into was with error
> reporting. Specifically, when there is an error on my part, I don?t
> seem to have any way to send a human readable message to the user.
>
> The issue seems to be related to the way that errors are handled in
> SVN. Under some conditions, it will accept the <m:human-readable
> errorcode=???> string, but in many cases, it will just ignore it,
> preferring to show a 500 Internal Server Error instead.
>
> Is there a consistent way to be able to send errors to SVN client and
> have it display them to the user?

This question should probably be asked on users@subversion.tigris.org.

When you post there, you might want to clarify whether you're talking
about errors from repository hook scripts, or something else.  I
couldn't quite grasp what your question was asking: Subversion generates
errors, but it doesn't "accept" them, so I wasn't sure what you meant or
what you're trying to do.

Good luck,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Custom error messages

Posted by David Glasser <gl...@davidglasser.net>.
On Fri, Mar 7, 2008 at 9:16 AM, Oren Eini (Murphy & Associates)
<v-...@microsoft.com> wrote:
>
>
>
>
> Hi,
>
> I am currently in the process of building SvnBridge
> (http://www.codeplex.com/SvnBridge/), a Subversion front end that talks to a
> Team System backend.
>
> One of the issues that I have run into was with error reporting.
> Specifically, when there is an error on my part, I don't seem to have any
> way to send a human readable message to the user.
>
> The issue seems to be related to the way that errors are handled in SVN.
> Under some conditions, it will accept the <m:human-readable errorcode="…">
> string, but in many cases, it will just ignore it, preferring to show a 500
> Internal Server Error instead.
>
> Is there a consistent way to be able to send errors to SVN client and have
> it display them to the user?

You could use svnserve instead of mod_dav_svn, which has a pretty
consistent error handling infrastructure.

--dave

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org