ciyidogan commited on
Commit
ecfaea7
·
verified ·
1 Parent(s): b4bef79

Update flare-ui/src/app/components/environment/environment.component.ts

Browse files
flare-ui/src/app/components/environment/environment.component.ts CHANGED
@@ -588,7 +588,11 @@ export class EnvironmentComponent implements OnInit {
588
  this.loadEnvironment();
589
  } catch (error) {
590
  console.error('Error in ngOnInit:', error);
591
- console.error('Stack trace:', error.stack);
 
 
 
 
592
  }
593
  }
594
 
@@ -668,6 +672,7 @@ export class EnvironmentComponent implements OnInit {
668
  duration: 3000
669
  });
670
  } catch (error) {
 
671
  this.snackBar.open('Invalid JSON file', 'Close', {
672
  duration: 3000,
673
  panelClass: 'error-snackbar'
@@ -766,7 +771,11 @@ export class EnvironmentComponent implements OnInit {
766
  }
767
  } catch (error) {
768
  console.error('Error in onSTTEngineChange:', error);
769
- console.error('Stack trace:', error.stack);
 
 
 
 
770
  }
771
  }
772
 
 
588
  this.loadEnvironment();
589
  } catch (error) {
590
  console.error('Error in ngOnInit:', error);
591
+ if (error instanceof Error) {
592
+ console.error('Stack trace:', error.stack);
593
+ } else {
594
+ console.error('Unknown error type:', error);
595
+ }
596
  }
597
  }
598
 
 
672
  duration: 3000
673
  });
674
  } catch (error) {
675
+ console.error('JSON parse error:', error);
676
  this.snackBar.open('Invalid JSON file', 'Close', {
677
  duration: 3000,
678
  panelClass: 'error-snackbar'
 
771
  }
772
  } catch (error) {
773
  console.error('Error in onSTTEngineChange:', error);
774
+ if (error instanceof Error) {
775
+ console.error('Stack trace:', error.stack);
776
+ } else {
777
+ console.error('Unknown error type:', error);
778
+ }
779
  }
780
  }
781