Merge pull request #1175 from umap-project/1026-cors-error
Handle CORS errors with an explicit message
This commit is contained in:
commit
a62d88140e
1 changed files with 9 additions and 2 deletions
|
@ -91,8 +91,15 @@ L.U.Xhr = L.Evented.extend({
|
|||
actions: actions,
|
||||
})
|
||||
} else {
|
||||
if (xhr.status !== 0) {
|
||||
// 0 === request cut by user
|
||||
if (xhr.status === 0) {
|
||||
// 0 === request cut by user or CORS
|
||||
self.ui.alert({
|
||||
content: L._(
|
||||
'Issue reaching that URL (network problem or CORS protection)'
|
||||
),
|
||||
level: 'error',
|
||||
})
|
||||
} else {
|
||||
self.ui.alert({ content: L._('Problem in the response'), level: 'error' })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue