Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
b78ebfcf
Commit
b78ebfcf
authored
Apr 08, 2023
by
pythongosssss
Browse files
Improve error UI
parent
12f9bfe8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
web/scripts/app.js
web/scripts/app.js
+14
-5
No files found.
web/scripts/app.js
View file @
b78ebfcf
...
...
@@ -872,12 +872,21 @@ class ComfyApp {
try
{
this
.
graph
.
configure
(
graphData
);
}
catch
(
error
)
{
let
errorHint
=
""
;
let
errorHint
=
[]
;
// Try extracting filename to see if it was caused by an extension script
const
filename
=
error
.
fileName
||
(
error
.
stack
||
""
).
match
(
/
(\/
extensions
\/
.*
\.
js
)
/
)?.[
1
];
const
pos
=
(
filename
||
""
).
indexOf
(
"
/extensions/
"
);
if
(
pos
>
-
1
)
{
errorHint
=
"
This may be due to the following script:
"
+
filename
.
substring
(
pos
+
12
);
errorHint
.
push
(
$el
(
"
span
"
,
{
textContent
:
"
This may be due to the following script:
"
}),
$el
(
"
br
"
),
$el
(
"
span
"
,
{
style
:
{
fontWeight
:
"
bold
"
,
},
textContent
:
filename
.
substring
(
pos
),
})
);
}
// Show dialog to let the user know something went wrong loading the data
...
...
@@ -895,14 +904,14 @@ class ComfyApp {
fontSize
:
"
10px
"
,
maxHeight
:
"
50vh
"
,
overflow
:
"
auto
"
,
backgroundColor
:
"
rgba(
255
,0,0,0.2)
"
,
backgroundColor
:
"
rgba(
0
,0,0,0.2)
"
,
},
textContent
:
error
.
stack
||
"
No stacktrace available
"
,
}),
$el
(
"
span
"
,
{
textContent
:
errorHint
,
style
:
{
fontWeight
:
"
bold
"
}
})
,
...
errorHint
,
]).
outerHTML
);
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment