Skip to content
Snippets Groups Projects
Commit c99b54fe authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

FIX: improve error logging

parent acc8bf8e
No related branches found
No related tags found
No related merge requests found
...@@ -747,7 +747,7 @@ export default { ...@@ -747,7 +747,7 @@ export default {
headers: { 'Authorization': 'Bearer ' + this.$parent.user.access_token } headers: { 'Authorization': 'Bearer ' + this.$parent.user.access_token }
}).then(response => { }).then(response => {
if (response.data.length === 0) { if (response.data.length === 0) {
alert('There are now shows associated with your account!') alert('There are no shows associated with your account!')
return return
} }
this.shows = response.data this.shows = response.data
...@@ -756,7 +756,9 @@ export default { ...@@ -756,7 +756,9 @@ export default {
this.loaded.shows = true this.loaded.shows = true
this.switchShow(this.currentShow) this.switchShow(this.currentShow)
}).catch(error => { }).catch(error => {
alert('There was an error fetching shows from steering: ' + error) console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not fetch shows from steering. See console for details.')
}) })
}, },
...@@ -882,9 +884,9 @@ export default { ...@@ -882,9 +884,9 @@ export default {
}).then( }).then(
this.fetchPlaylists(this.shows[this.currentShow].slug) this.fetchPlaylists(this.shows[this.currentShow].slug)
).catch(error => { ).catch(error => {
console.log('Error:') console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error) console.log(error.response)
alert('Error: could not delete playlist. See console log for details.') alert('Error: could not delete playlist. See console for details.')
}) })
}, },
...@@ -936,7 +938,7 @@ export default { ...@@ -936,7 +938,7 @@ export default {
}).catch(error => { }).catch(error => {
console.log('Error: ' + error.response.status + ' ' + error.response.statusText) console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response) console.log(error.response)
alert('Error: could not add new playlist. See console log for details.') alert('Error: could not add new playlist. See console for details.')
}) })
// when updating an existing playlist we use a PUT request and add the id // when updating an existing playlist we use a PUT request and add the id
...@@ -954,7 +956,7 @@ export default { ...@@ -954,7 +956,7 @@ export default {
}).catch(error => { }).catch(error => {
console.log('Error: ' + error.response.status + ' ' + error.response.statusText) console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response) console.log(error.response)
alert('Error: could not update playlist. See console log for details.') alert('Error: could not update playlist. See console for details.')
}) })
} }
}, },
...@@ -994,9 +996,9 @@ export default { ...@@ -994,9 +996,9 @@ export default {
}).then(response => { }).then(response => {
this.getFileById(this.temp.id).metadata = response.data.metadata this.getFileById(this.temp.id).metadata = response.data.metadata
}).catch(error => { }).catch(error => {
console.log('Error:') console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error) console.log(error.response)
alert('Error: could not save metadata info to file. See console log for details.') alert('Error: could not save metadata info to file. See console for details.')
}) })
} }
}, },
...@@ -1012,9 +1014,9 @@ export default { ...@@ -1012,9 +1014,9 @@ export default {
}).then( }).then(
this.fetchFiles(this.shows[this.currentShow].slug) this.fetchFiles(this.shows[this.currentShow].slug)
).catch(error => { ).catch(error => {
console.log('Error:') console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error) console.log(error.response)
alert('Error: could not delete file. See console log for details.') alert('Error: could not delete file. See console for details.')
}) })
}, },
...@@ -1036,9 +1038,9 @@ export default { ...@@ -1036,9 +1038,9 @@ export default {
this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 250) this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 250)
} }
}).catch(error => { }).catch(error => {
console.log('Error:') console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error) console.log(error.response)
alert('Error: could not add the new remote import. See console log for details.') alert('Error: could not add the new remote import. See console for details.')
}) })
} else if (this.uploadSourceFile) { } else if (this.uploadSourceFile) {
// TODO: add mechanism to indicate the running post request in the files table // TODO: add mechanism to indicate the running post request in the files table
...@@ -1052,9 +1054,9 @@ export default { ...@@ -1052,9 +1054,9 @@ export default {
this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 250) this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 250)
} }
}).catch(error => { }).catch(error => {
console.log('Error:') console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error) console.log(error.response)
alert('Error: could not add the new file upload. See console log for details.') alert('Error: could not add the new file upload. See console for details.')
}) })
} else { } else {
alert('Something is wrong. You have choosen to upload a file, but the corresponding file object does not exist.') alert('Something is wrong. You have choosen to upload a file, but the corresponding file object does not exist.')
...@@ -1073,9 +1075,9 @@ export default { ...@@ -1073,9 +1075,9 @@ export default {
}).then( }).then(
this.upload(id) this.upload(id)
).catch(error => { ).catch(error => {
console.log('Error:') console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error) console.log(error.response)
alert('Error: could not start the file upload. See console log for details.') alert('Error: could not start the file upload. See console for details.')
}) })
}, },
...@@ -1097,7 +1099,7 @@ export default { ...@@ -1097,7 +1099,7 @@ export default {
}) })
flow.on('fileError', function(file, message) { flow.on('fileError', function(file, message) {
console.log(file, message) console.log(file, message)
alert('Error: could not upload your file. See console log for details.') alert('Error: could not upload your file. See console for details.')
}) })
flow.addFile(this.uploadSourceFile) flow.addFile(this.uploadSourceFile)
flow.upload() flow.upload()
...@@ -1117,9 +1119,9 @@ export default { ...@@ -1117,9 +1119,9 @@ export default {
// ideally we should refine this so that every single file gets updated independently) // ideally we should refine this so that every single file gets updated independently)
//this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 100) //this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 100)
}).catch(error => { }).catch(error => {
console.log('Error:') console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error) console.log(error.response)
alert('Error: could not start the file upload. See console log for details.') alert('Error: could not start the file upload. See console for details.')
}) })
}, },
...@@ -1178,8 +1180,9 @@ export default { ...@@ -1178,8 +1180,9 @@ export default {
} }
} }
}).catch(error => { }).catch(error => {
console.log(error) console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
alert('There was an error fetching current imports. See console for details.') console.log(error.response)
alert('Error: could not fetch current imports. See console for details.')
}) })
}, },
...@@ -1202,7 +1205,9 @@ export default { ...@@ -1202,7 +1205,9 @@ export default {
this.files = response.data.results this.files = response.data.results
this.loaded.files = true this.loaded.files = true
}).catch(error => { }).catch(error => {
alert('There was an error fetching files from tank: ' + error) console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not fetch files from tank. See console for details.')
}) })
}, },
...@@ -1219,7 +1224,9 @@ export default { ...@@ -1219,7 +1224,9 @@ export default {
this.playlists = response.data.results this.playlists = response.data.results
this.loaded.playlists = true this.loaded.playlists = true
}).catch(error => { }).catch(error => {
alert('There was an error fetching playlists from tank: ' + error) console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not fetch playlists from tank. See console for details.')
}) })
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment