@@ -21,7 +21,7 @@ angular.module('mm.addons.mod_choice')
2121 * @ngdoc service
2222 * @name $mmaModChoiceHandlers
2323 */
24- . factory ( '$mmaModChoiceHandlers' , function ( $mmCourse , $mmaModChoice , $state , $mmContentLinksHelper , $mmUtil , $mmEvents , $mmSite ,
24+ . factory ( '$mmaModChoiceHandlers' , function ( $mmCourse , $mmaModChoice , $state , $mmContentLinksHelper , $mmUtil , $mmEvents , $mmSite , $q ,
2525 $mmaModChoicePrefetchHandler , $mmCoursePrefetchDelegate , mmCoreDownloading , mmCoreNotDownloaded , mmCoreOutdated ,
2626 mmaModChoiceComponent , mmCoreEventPackageStatusChanged , mmCoreDownloaded , $mmaModChoiceSync ) {
2727 var self = { } ;
@@ -103,9 +103,10 @@ angular.module('mm.addons.mod_choice')
103103 // Get download size to ask for confirm if it's high.
104104 $mmaModChoicePrefetchHandler . getDownloadSize ( module , courseId ) . then ( function ( size ) {
105105 $mmUtil . confirmDownloadSize ( size ) . then ( function ( ) {
106- $mmaModChoicePrefetchHandler . prefetch ( module , courseId ) . catch ( function ( ) {
106+ return $mmaModChoicePrefetchHandler . prefetch ( module , courseId ) . catch ( function ( error ) {
107107 if ( ! $scope . $$destroyed ) {
108- $mmUtil . showErrorModal ( 'mm.core.errordownloading' , true ) ;
108+ $mmUtil . showErrorModalDefault ( error , 'mm.core.errordownloading' , true ) ;
109+ return $q . reject ( ) ;
109110 }
110111 } ) ;
111112 } ) . catch ( function ( ) {
0 commit comments