sarutak commented on code in PR #43547:
URL: https://github.com/apache/spark/pull/43547#discussion_r1375487690
##########
core/src/main/resources/org/apache/spark/ui/static/utils.js:
##########
@@ -231,4 +231,42 @@ function createRESTEndPointForMiscellaneousProcess(appId) {
function getBaseURI() {
return document.baseURI || document.URL;
}
-/* eslint-enable no-unused-vars */
\ No newline at end of file
+
+function detailsUINode(isMultiline, message) {
+ if (isMultiline) {
+ const span = '<span
onclick="this.parentNode.querySelector(\'.stacktrace-details\').classList.toggle(\'collapsed\')"
class="expand-details">+details</span>';
+ const pre = '<pre>' + message + '</pre>';
+ const div = '<div class="stacktrace-details collapsed">' + pre + '</div>';
+ return span + div;
+ } else {
+ return '';
+ }
+}
+
+const ERROR_CLASS_REGEX = /\[([A-Z][A-Z_.]+[A-Z])\]/;
+
+/* This function works exactly the same as UIUtils.errorSummary, it shall be
+ * remained the same whichever changed */
+function errorSummary(errorMessage) {
+ let isMultiline = true;
+ const maybeErrorClass = errorMessage.match(ERROR_CLASS_REGEX);
+ let errorClassOrBrief;
+ if (maybeErrorClass) {
Review Comment:
Is it better to check the length of `maybeErrorClass` is enough?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]