@@ -2487,8 +2487,7 @@ Plotly.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
2487
2487
gd = getGraphDiv ( gd ) ;
2488
2488
2489
2489
if ( ! Lib . isPlotDiv ( gd ) ) {
2490
- Lib . warn ( 'This element is not a Plotly plot.' , gd ) ;
2491
- return Promise . reject ( ) ;
2490
+ throw new Error ( 'This element is not a Plotly plot: ' + gd ) ;
2492
2491
}
2493
2492
2494
2493
var trans = gd . _transitionData ;
@@ -2771,8 +2770,7 @@ Plotly.addFrames = function(gd, frameList, indices) {
2771
2770
gd = getGraphDiv ( gd ) ;
2772
2771
2773
2772
if ( ! Lib . isPlotDiv ( gd ) ) {
2774
- Lib . warn ( 'This element is not a Plotly plot.' , gd ) ;
2775
- return Promise . reject ( ) ;
2773
+ throw new Error ( 'This element is not a Plotly plot: ' + gd ) ;
2776
2774
}
2777
2775
2778
2776
var i , frame , j , idx ;
@@ -2781,8 +2779,7 @@ Plotly.addFrames = function(gd, frameList, indices) {
2781
2779
2782
2780
2783
2781
if ( ! Array . isArray ( frameList ) ) {
2784
- Lib . warn ( 'addFrames failure: frameList must be an Array of frame definitions' , frameList ) ;
2785
- return Promise . reject ( ) ;
2782
+ throw new Error ( 'addFrames failure: frameList must be an Array of frame definitions' + frameList ) ;
2786
2783
}
2787
2784
2788
2785
// Create a sorted list of insertions since we run into lots of problems if these
@@ -2860,8 +2857,7 @@ Plotly.deleteFrames = function(gd, frameList) {
2860
2857
gd = getGraphDiv ( gd ) ;
2861
2858
2862
2859
if ( ! Lib . isPlotDiv ( gd ) ) {
2863
- Lib . warn ( 'This element is not a Plotly plot.' , gd ) ;
2864
- return Promise . reject ( ) ;
2860
+ throw new Error ( 'This element is not a Plotly plot: ' + gd ) ;
2865
2861
}
2866
2862
2867
2863
var i , idx ;
0 commit comments