@@ -2486,8 +2486,7 @@ Plotly.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
24862486 gd = getGraphDiv ( gd ) ;
24872487
24882488 if ( ! Lib . isPlotDiv ( gd ) ) {
2489- Lib . warn ( 'This element is not a Plotly plot.' , gd ) ;
2490- return Promise . reject ( ) ;
2489+ throw new Error ( 'This element is not a Plotly plot: ' + gd ) ;
24912490 }
24922491
24932492 var trans = gd . _transitionData ;
@@ -2770,8 +2769,7 @@ Plotly.addFrames = function(gd, frameList, indices) {
27702769 gd = getGraphDiv ( gd ) ;
27712770
27722771 if ( ! Lib . isPlotDiv ( gd ) ) {
2773- Lib . warn ( 'This element is not a Plotly plot.' , gd ) ;
2774- return Promise . reject ( ) ;
2772+ throw new Error ( 'This element is not a Plotly plot: ' + gd ) ;
27752773 }
27762774
27772775 var i , frame , j , idx ;
@@ -2780,8 +2778,7 @@ Plotly.addFrames = function(gd, frameList, indices) {
27802778
27812779
27822780 if ( ! Array . isArray ( frameList ) ) {
2783- Lib . warn ( 'addFrames failure: frameList must be an Array of frame definitions' , frameList ) ;
2784- return Promise . reject ( ) ;
2781+ throw new Error ( 'addFrames failure: frameList must be an Array of frame definitions' + frameList ) ;
27852782 }
27862783
27872784 // Create a sorted list of insertions since we run into lots of problems if these
@@ -2859,8 +2856,7 @@ Plotly.deleteFrames = function(gd, frameList) {
28592856 gd = getGraphDiv ( gd ) ;
28602857
28612858 if ( ! Lib . isPlotDiv ( gd ) ) {
2862- Lib . warn ( 'This element is not a Plotly plot.' , gd ) ;
2863- return Promise . reject ( ) ;
2859+ throw new Error ( 'This element is not a Plotly plot: ' + gd ) ;
28642860 }
28652861
28662862 var i , idx ;
0 commit comments