You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/08/09 15:13:04 UTC

[GitHub] [netbeans] mbien opened a new pull request, #4490: Exception reporter improvments

mbien opened a new pull request, #4490:
URL: https://github.com/apache/netbeans/pull/4490

   We see users periodically reporting issues for old NB versions (e.g #4477 + discussion). So I wanted to see if the messaging could be a little bit improved.
   It turned out that the exception reporter was a little bit broken, the message didn't fit into the window and it had no scrollbars, so the user would only see part of it.
   
   related update to website:
    - https://github.com/apache/netbeans-website/pull/603
   
   this PR:
    - improved the messages
      * emphasized latest release requirement
      * switched text to html
      * added hyperlinks which open the issue page/log folder (having long URIs in wrapping/scrolling text is annoying)
    - wrapped TextArea of NotifyDescriptor into a ScrollPane
    - switched stack trace pane (show details) to TextArea and disabled line wrap
    - slightly larger dimensions for everything
   
   ![exception-report_improved](https://user-images.githubusercontent.com/114367/183682460-7eb7127a-45f4-492b-b379-f9fa9ba7c39f.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#issuecomment-1213141123

   How ready is this? Because I'm tempted to say these changes are worth sneaking into NB15-rc4.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r941657199


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +490,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), CLIOptions.getLogDir() }
                     );
-
                     title = curBundle.getString("NTF_ExceptionalExceptionTitle"); // NOI18N
                 }
+                JTextPane pane = new JTextPane();
+                pane.setContentType("text/html"); // NOI18N
+                pane.setText(message);
+                pane.setBackground(UIManager.getColor("Label.background")); // NOI18N
+                pane.setBorder(BorderFactory.createEmptyBorder());
+                pane.setEditable(false);
+                pane.setFocusable(true);
+                pane.addHyperlinkListener((e) -> {
+                    if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
+                        try {
+                            Desktop.getDesktop().browse(e.getURL().toURI());

Review Comment:
   one is a `file://` the other is a `https://`. It does open the folder for me in nemo, my filesystem explorer and the site in firefox.
   
   does this work for you?
   ```java
       public static void main(String[] args) throws IOException {
           Desktop.getDesktop().browse(URI.create("file:///tmp/"));
       }
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r944555368


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +491,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), Paths.get(CLIOptions.getLogDir()).toUri() }

Review Comment:
   this should hopefully work on windows. `getLogDir()` returns `new File(...).toString()` and is parsed again to `Path` and then converted to `URI` to finally insert it as `href="file://"` into the HTML :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r944554090


##########
nb/ide.branding/o.n.core/src/org/netbeans/core/Bundle_nb.properties:
##########
@@ -18,9 +18,10 @@
 # {0} - class name of exception
 # {1} - path to system folder
 NTF_ExceptionalException=\
-        A {0} exception has occurred.\n\
-	Please report this at https://netbeans.apache.org/nb/report-issue,\n\
-	including a copy of your messages.log file as an attachment.\n\
-	The messages.log file is located in your {1} folder.
+    A <code>{0}</code> has occurred.<br/><br/>\
+	If you are running the latest version of NetBeans you can \
+    <a href="https://netbeans.apache.org/nb/report-issue">report this</a>, \
+	including a copy of your messages.log file as an attachment.<br/><br/>\
+	The messages.log file is located in <a href="file://{1}">this folder</a>.

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#issuecomment-1213164253

   > How ready is this? Because I'm tempted to say these changes are worth sneaking into NB15-rc4.
   
   it is basically ready. I just got the thought to maybe link "latest" to the download page (https://github.com/apache/netbeans/pull/4490#discussion_r944437999). Other than that its ready from my perspective. Should I do that?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net merged pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
neilcsmith-net merged PR #4490:
URL: https://github.com/apache/netbeans/pull/4490


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r944437999


##########
nb/ide.branding/o.n.core/src/org/netbeans/core/Bundle_nb.properties:
##########
@@ -18,9 +18,10 @@
 # {0} - class name of exception
 # {1} - path to system folder
 NTF_ExceptionalException=\
-        A {0} exception has occurred.\n\
-	Please report this at https://netbeans.apache.org/nb/report-issue,\n\
-	including a copy of your messages.log file as an attachment.\n\
-	The messages.log file is located in your {1} folder.
+    A <code>{0}</code> has occurred.<br/><br/>\
+	If you are running the latest version of NetBeans you can \
+    <a href="https://netbeans.apache.org/nb/report-issue">report this</a>, \
+	including a copy of your messages.log file as an attachment.<br/><br/>\
+	The messages.log file is located in <a href="file://{1}">this folder</a>.

Review Comment:
   @lkishalmi you think I should add a hyperlink to "latest" too with leads to the download page?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#issuecomment-1216366406

   Tested dialog and links on Linux and Windows.  Looks good to me.  Merging.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r944555368


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +491,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), Paths.get(CLIOptions.getLogDir()).toUri() }

Review Comment:
   this should hopefully work on windows. `getLogDir()` returns `new File(...).toString()` and is parsed again to `Path` and then converted to `URI` to finally insert it as hfref="file://" into the HTML :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r944555368


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +491,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), Paths.get(CLIOptions.getLogDir()).toUri() }

Review Comment:
   this should hopefully work on windows. getLogDir() returns new File(...).toString() and is converted again to path and then to URI.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r944555368


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +491,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), Paths.get(CLIOptions.getLogDir()).toUri() }

Review Comment:
   this should hopefully work on windows. `getLogDir()` returns `new File(...).toString()` and is parsed again to path and then to URI.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r941652209


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +490,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), CLIOptions.getLogDir() }
                     );
-
                     title = curBundle.getString("NTF_ExceptionalExceptionTitle"); // NOI18N
                 }
+                JTextPane pane = new JTextPane();
+                pane.setContentType("text/html"); // NOI18N
+                pane.setText(message);
+                pane.setBackground(UIManager.getColor("Label.background")); // NOI18N
+                pane.setBorder(BorderFactory.createEmptyBorder());
+                pane.setEditable(false);
+                pane.setFocusable(true);
+                pane.addHyperlinkListener((e) -> {
+                    if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
+                        try {
+                            Desktop.getDesktop().browse(e.getURL().toURI());

Review Comment:
   Wouldn't this one open a browser either on "report this" or "this folder"?
   Could we use ```Desktop.getDesktop().open()``` for the later one?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#issuecomment-1213214360

   * rebased to delivery
   * linked "latest" to download page
   * fixed URI so that it should work on windows, not planning to test it though since I don't have a win setup ready


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r941657199


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +490,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), CLIOptions.getLogDir() }
                     );
-
                     title = curBundle.getString("NTF_ExceptionalExceptionTitle"); // NOI18N
                 }
+                JTextPane pane = new JTextPane();
+                pane.setContentType("text/html"); // NOI18N
+                pane.setText(message);
+                pane.setBackground(UIManager.getColor("Label.background")); // NOI18N
+                pane.setBorder(BorderFactory.createEmptyBorder());
+                pane.setEditable(false);
+                pane.setFocusable(true);
+                pane.addHyperlinkListener((e) -> {
+                    if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
+                        try {
+                            Desktop.getDesktop().browse(e.getURL().toURI());

Review Comment:
   one is a `file://` the other is a `https://`. It does open the folder for me (not in the browser, in nemo, my filesystem explorer).
   
   does this work for you?
   ```java
       public static void main(String[] args) throws IOException {
           Desktop.getDesktop().browse(URI.create("file:///tmp/"));
       }
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r945948080


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +491,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), Paths.get(CLIOptions.getLogDir()).toUri() }

Review Comment:
   I'll check this on a Windows box.  To be pedantic, `file://C:...` would never be correct - should be one slash or three.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
mbien commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r944555368


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +491,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), Paths.get(CLIOptions.getLogDir()).toUri() }

Review Comment:
   this should hopefully work on windows. `getLogDir()` returns `new File(...).toString()` and is parsed again to `Path` and then converted to `URI` to finally insert it as String into the HTML :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on a diff in pull request #4490: Exception reporter improvments

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r941663581


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +490,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), CLIOptions.getLogDir() }
                     );
-
                     title = curBundle.getString("NTF_ExceptionalExceptionTitle"); // NOI18N
                 }
+                JTextPane pane = new JTextPane();
+                pane.setContentType("text/html"); // NOI18N
+                pane.setText(message);
+                pane.setBackground(UIManager.getColor("Label.background")); // NOI18N
+                pane.setBorder(BorderFactory.createEmptyBorder());
+                pane.setEditable(false);
+                pane.setFocusable(true);
+                pane.addHyperlinkListener((e) -> {
+                    if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
+                        try {
+                            Desktop.getDesktop().browse(e.getURL().toURI());

Review Comment:
   This brings up nautilus for me. So this is fine then.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists