Copilot commented on code in PR #6288:
URL: https://github.com/apache/texera/pull/6288#discussion_r3553230507


##########
frontend/src/app/workspace/component/result-panel/error-frame/error-frame.component.ts:
##########
@@ -72,11 +72,39 @@ export class ErrorFrameComponent implements OnInit {
       errorMessages = errorMessages.filter(err => err.operatorId === 
this.operatorId);
     }
     this.categoryToErrorMapping = errorMessages.reduce((acc, obj) => {
-      const key = obj.type.name;
+      let key = obj.type.name;
+      let message = obj.message;
+      let details = obj.details;
+
+      if (key === "COMPILATION_ERROR") {
+        // Strip out common Java exception class names and formatting to make 
it more user-friendly
+        const exceptionRegex = 
/^\s*(?:[a-zA-Z0-9_]+\.)+[a-zA-Z0-9_]+Exception:\s*/;
+        const requirementFailedRegex = /^\s*requirement failed:\s*/;
+        const genericExceptionRegex = /^\s*Exception:\s*/;

Review Comment:
   `exceptionRegex` only matches *fully-qualified* exception class names (must 
contain at least one `.`), so messages like `SQLException: ...` or 
`IllegalArgumentException: ...` (unqualified) won’t be stripped even though 
they’re common in Java/Scala error output. Consider allowing an optional 
package prefix and (optionally) `Error` as well.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to