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 <[email protected]> schrieb:

> Datum: Wed, 6 May 2009 21:01:26 +0000 (GMT)
> Von: Mark Struberg <[email protected]>
> Betreff: how to treat Exceptions in ScmResults?
> An: [email protected]
> 
> 
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to