-
Notifications
You must be signed in to change notification settings - Fork 21
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
Generate webpage in case of exceptions #93
base: main
Are you sure you want to change the base?
Conversation
|
yeah looks like desktop not available in native yet. having custom launch implmeented probably best approach if headless exception thrown |
Have added OS Specific ways to open up webpage : fahad-israr@4269882 |
@@ -8,6 +8,8 @@ | |||
|
|||
package dev.starfix; | |||
import io.quarkus.runtime.annotations.RegisterForReflection; | |||
import jdk.jfr.StackTrace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
@@ -341,6 +360,44 @@ public static void processCloneURL(CloneUrl cloneUrl) throws URISyntaxException, | |||
|
|||
} | |||
|
|||
public static void generateHTML(StackTraceElement[] stacktrace, String message)throws IOException, InterruptedException{ | |||
String userHome = System.getProperty("user.home"); | |||
File f = new File(userHome+"/starfixException.html"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would cause conflicts if concurrent runs.
shuold also put it in temporary directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have made it a temp file now and delete it on exit .
throw new IllegalArgumentException("Not a valid URI for git repository"); | ||
String message = "Not a valid URI for git repository: "+cloneUrl.url; | ||
Exception illegalArgumentException = new IllegalArgumentException(message); | ||
generateHTML(illegalArgumentException.getStackTrace(),message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think better to just pass in the exception then you can also pass message and other context in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes 👍
have changed it now.
@maxandersen This PR is ready for a review. |
cloneCmd(uri); | ||
}catch(Exception e){ | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never ok to just print out stacktrace in case of error. need to handle it or guide the user.
Related Issue: Showing up webpage incase of issues #41