Generate webpage in case of exceptions#93
Generate webpage in case of exceptions#93fahad-israr wants to merge 3 commits intostarfixdev:mainfrom
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 |
|
|
||
| package dev.starfix; | ||
| import io.quarkus.runtime.annotations.RegisterForReflection; | ||
| import jdk.jfr.StackTrace; |
|
|
||
| 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.
this would cause conflicts if concurrent runs.
shuold also put it in temporary directory.
There was a problem hiding this comment.
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.
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.
yes 👍
have changed it now.
|
@maxandersen This PR is ready for a review. |
| try{ | ||
| cloneCmd(uri); | ||
| }catch(Exception e){ | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
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