Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when the provided sonar host url is not a valid URI format #1554

Closed
sebastien-marichal opened this issue Apr 3, 2023 · 0 comments · Fixed by #1556
Closed

Fix error when the provided sonar host url is not a valid URI format #1554

sebastien-marichal opened this issue Apr 3, 2023 · 0 comments · Fixed by #1556
Assignees
Milestone

Comments

@sebastien-marichal
Copy link
Contributor

When providing an URL that does not have a valid URI format, it produces a nonuser-friendly output.

Instead of the exception, a better user-friendly message should be reported.

Steps to reproduce

SonarScanner.MSBuild.exe begin /k:test /d:sonar.host.url=https:/google.com

Output

SonarScanner for MSBuild 5.13
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
14:37:03.415  Updating build integration targets...

Unhandled Exception: System.UriFormatException: Invalid URI: The Authority/Host could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at SonarScanner.MSBuild.Common.WebUtils.CreateUri(String uri)
   at SonarScanner.MSBuild.PreProcessor.PreprocessorObjectFactory.<CreateSonarWebServer>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.PreProcessor.PreProcessor.<DoExecute>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.PreProcessor.PreProcessor.<Execute>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.BootstrapperClass.<PreProcess>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.BootstrapperClass.<Execute>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.Program.<Execute>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.Program.<Execute>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.Program.<Main>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.Program.<Main>(String[] args)
@sebastien-marichal sebastien-marichal added this to the 5.13.0 milestone Apr 3, 2023
@sebastien-marichal sebastien-marichal self-assigned this Apr 3, 2023
@sebastien-marichal sebastien-marichal added this to To do in S4NET Kanban via automation Apr 3, 2023
@sebastien-marichal sebastien-marichal moved this from To do to In progress in S4NET Kanban Apr 3, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in S4NET Kanban Apr 3, 2023
@github-actions github-actions bot moved this from Review in progress to In progress in S4NET Kanban Apr 3, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in S4NET Kanban Apr 3, 2023
@github-actions github-actions bot moved this from Review in progress to Reviewer approved in S4NET Kanban Apr 3, 2023
S4NET Kanban automation moved this from Reviewer approved to Done Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
S4NET Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants