 					# console.log 'resolved q.all, page size is', result
 					$scope.numPages = result.numPages
 				.catch (error) ->
-					$scope.$emit 'pdf:error', 'loading initial document parameters'
+					$scope.$emit 'pdf:error', error
+					return $q.reject(error)
 
 		@setScale = (scale, containerHeight, containerWidth) ->
 			$scope.loaded.then () ->

									spinner.remove(element)
								ctrl.redraw(origposition)
								$timeout renderVisiblePages

				elementTimer = null
				spinnerTimer = null

					# console.log 'loading pdf', newVal, oldVal
					return unless newVal?
					scope.loadCount = 0; # new pdf, so reset load count
					scope.loadSuccess = false
					ctrl.load()
					# trigger a redraw
					scope.scale = angular.copy (scope.scale)
