mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
handle error loading pdf
This commit is contained in:
parent
d9a3776183
commit
1a8438be5f
1 changed files with 3 additions and 1 deletions
|
@ -58,6 +58,8 @@ define [
|
||||||
]
|
]
|
||||||
# console.log 'resolved q.all, page size is', result
|
# console.log 'resolved q.all, page size is', result
|
||||||
$scope.numPages = result.numPages
|
$scope.numPages = result.numPages
|
||||||
|
.catch (error) ->
|
||||||
|
$scope.$emit 'pdf:error', 'loading initial document parameters'
|
||||||
|
|
||||||
@setScale = (scale, containerHeight, containerWidth) ->
|
@setScale = (scale, containerHeight, containerWidth) ->
|
||||||
$scope.loaded.then () ->
|
$scope.loaded.then () ->
|
||||||
|
@ -359,7 +361,7 @@ define [
|
||||||
scope.$on 'pdf:error', (event, error) ->
|
scope.$on 'pdf:error', (event, error) ->
|
||||||
return if error == 'cancelled'
|
return if error == 'cancelled'
|
||||||
# check if too many retries or file is missing
|
# check if too many retries or file is missing
|
||||||
if scope.loadCount > 3 || error.match(/^Missing PDF/i)
|
if scope.loadCount > 3 || error.match(/^Missing PDF/i) || error.match(/^loading/i)
|
||||||
scope.$emit 'pdf:error:display'
|
scope.$emit 'pdf:error:display'
|
||||||
return
|
return
|
||||||
ctrl.load()
|
ctrl.load()
|
||||||
|
|
Loading…
Reference in a new issue