added try catch block on streamNodeData
This commit is contained in:
parent
d14be904ad
commit
86751e0daf
1 changed files with 32 additions and 26 deletions
|
|
@ -60,7 +60,7 @@ export default function BuildTrigger({
|
||||||
let finished = false;
|
let finished = false;
|
||||||
apiUrl = `/build/stream/${flowId}`;
|
apiUrl = `/build/stream/${flowId}`;
|
||||||
const eventSource = new EventSource(apiUrl);
|
const eventSource = new EventSource(apiUrl);
|
||||||
|
try{
|
||||||
eventSource.onmessage = (event) => {
|
eventSource.onmessage = (event) => {
|
||||||
// If the event is parseable, return
|
// If the event is parseable, return
|
||||||
if (!event.data) {
|
if (!event.data) {
|
||||||
|
|
@ -90,6 +90,12 @@ export default function BuildTrigger({
|
||||||
// Step 4: Return true if all nodes are valid, false otherwise
|
// Step 4: Return true if all nodes are valid, false otherwise
|
||||||
return validationResults.every((result) => result);
|
return validationResults.every((result) => result);
|
||||||
}
|
}
|
||||||
|
catch(e){
|
||||||
|
console.log(e)
|
||||||
|
eventSource.close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function processStreamResult(parsedData) {
|
function processStreamResult(parsedData) {
|
||||||
// Process each chunk of data here
|
// Process each chunk of data here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue