You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Mark Struberg <st...@yahoo.de> on 2009/05/09 12:07:15 UTC
FWD: how to treat Exceptions in ScmResults?
Oki, once again, now on maven-dev ;)
After talking to a few people on IRC, it seems that the error handling in maven-scm could be made
a bit more easier.
Currently there are 2 ways for a scm provider to 'report' that there has been something wrong in
executing a SCM command (e..g. 'svn up')
1.) scm-providers may trow a ScmException
2.) scm-providers may return ScmResult(..., success=false)
After looking over the sources it seems to me that in a higher layer if succeed==false an
ScmException is thrown anyway.
So why do we still need the success flag in the ScmResult?
Is there a need to distinct between 'technical' or 'hard' errors which should result in a
ScmException on the one hand and 'processing failures' which should result in a ScmResult on the
other hand?
Imho we could safely drop the success flag in ScmResult and handle all failures via ScmExceptions.
We could maybe introduce a CliScmException or add a CLI specific constructor to ScmException for
easier integration into CLI based scm providers like maven-scm-provider-svnexe.
LieGrue,
strub
--- Mark Struberg <st...@yahoo.de> schrieb:
> Datum: Wed, 6 May 2009 21:01:26 +0000 (GMT)
> Von: Mark Struberg <st...@yahoo.de>
> Betreff: how to treat Exceptions in ScmResults?
> An: scm-dev@maven.apache.org
>
>
> Hi!
>
> I'm currently implementing the maven-scm-providers-jgit and like to know how others did handle
> e.g. CheckOutScmResult for Java implemented SCM connectors. Especially what to do if an
> Exception occurred? How do you transport this nested Exception? fill only e.getMessage() or is
> there a trick I miss?
>
> Currently I'm doing
> > return new CheckOutScmResult("", "JGit clone failed.", e.getMessage(), false );
> but this doesn't feel ok somehow.
>
> txs and LieGrue,
> strub
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org