[ 
https://issues.apache.org/jira/browse/SCM-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17960092#comment-17960092
 ] 

ASF GitHub Bot commented on SCM-31:
-----------------------------------

jira-importer commented on issue #323:
URL: https://github.com/apache/maven-scm/issues/323#issuecomment-2964585667

   **[Dennis 
Lundberg](https://issues.apache.org/jira/secure/[email protected])**
 commented
   
   Where in the code chain would you like this? I looked at the code and found 
this chain of execution regarding validation of the scmUrl:
   
   maven-scm-plugin
   - ValidateMojo.execute()
   - ValidateMojo.validateConnection( String connectionString, String type )
   
   maven-scm-api
   - AbstractScmManager.validateScmRepository( String scmUrl )
   - AbstractScmProvider.validateScmUrl( String scmSpecificUrl, char delimiter )
   
   maven-scm-provider
   - CvsScmProvider.validateScmUrl( String scmSpecificUrl, char delimiter ) / 
SvnScmProvider.validateScmUrl( String scmSpecificUrl, char delimiter )
   - CvsScmProvider.parseScmUrl( String scmSpecificUrl, char delimiter ) / 
SvnScmProvider.validateScmUrl( String scmSpecificUrl, char delimiter )
   
   The other scm implementations just uses the default implementation available 
in AbstractScmProvider which makes a call to makeProviderScmRepository( String 
scmSpecificUrl, char delimiter )
   
   My choice would be to put the resource files inside maven-scm-api somewhere, 
and put constants defining the error messages in AbstractScmProvider.
   
   To make this work we also need a list of possible error codes. Here's 
something to start with. It's basically a harvesting from the chain above:
   
   - Malformed URL
   - Cannot be null
   - Must start with "scm"
   - No such provider
   - The SCM provider cannot return null from validateScmUrl()
   - Illegal delimiter
   - Too few tokens
   - Too many tokens
   - Unknown transport (found in cvs provider)
   - Various "The user_password_host part must be on the form: ..\<specific 
format>." (found in cvs provider)
   - Various "A svn '\<protocol>' url must be on the form ...\<specific 
format>" (found in svn provider)
   
   




> The scm url validator should return a code corresponding to the error
> ---------------------------------------------------------------------
>
>                 Key: SCM-31
>                 URL: https://issues.apache.org/jira/browse/SCM-31
>             Project: Maven SCM (Moved to GitHub Issues)
>          Issue Type: Improvement
>    Affects Versions: 1.0-alpha-1
>            Reporter: Jason van Zyl
>            Priority: Major
>
> I would like an error code to be returned so that I can use the error code to 
> select an i18n key that will provide users with a localized error message.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to