Commit c99b54fe authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

FIX: improve error logging

parent acc8bf8e
......@@ -747,7 +747,7 @@ export default {
headers: { 'Authorization': 'Bearer ' + this.$parent.user.access_token }
}).then(response => {
if (response.data.length === 0) {
alert('There are now shows associated with your account!')
alert('There are no shows associated with your account!')
return
}
this.shows = response.data
......@@ -756,7 +756,9 @@ export default {
this.loaded.shows = true
this.switchShow(this.currentShow)
}).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 {
}).then(
this.fetchPlaylists(this.shows[this.currentShow].slug)
).catch(error => {
console.log('Error:')
console.log(error)
alert('Error: could not delete playlist. See console log for details.')
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not delete playlist. See console for details.')
})
},
......@@ -936,7 +938,7 @@ export default {
}).catch(error => {
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
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
......@@ -954,7 +956,7 @@ export default {
}).catch(error => {
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
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 {
}).then(response => {
this.getFileById(this.temp.id).metadata = response.data.metadata
}).catch(error => {
console.log('Error:')
console.log(error)
alert('Error: could not save metadata info to file. See console log for details.')
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not save metadata info to file. See console for details.')
})
}
},
......@@ -1012,9 +1014,9 @@ export default {
}).then(
this.fetchFiles(this.shows[this.currentShow].slug)
).catch(error => {
console.log('Error:')
console.log(error)
alert('Error: could not delete file. See console log for details.')
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not delete file. See console for details.')
})
},
......@@ -1036,9 +1038,9 @@ export default {
this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 250)
}
}).catch(error => {
console.log('Error:')
console.log(error)
alert('Error: could not add the new remote import. See console log for details.')
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not add the new remote import. See console for details.')
})
} else if (this.uploadSourceFile) {
// TODO: add mechanism to indicate the running post request in the files table
......@@ -1052,9 +1054,9 @@ export default {
this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 250)
}
}).catch(error => {
console.log('Error:')
console.log(error)
alert('Error: could not add the new file upload. See console log for details.')
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not add the new file upload. See console for details.')
})
} else {
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 {
}).then(
this.upload(id)
).catch(error => {
console.log('Error:')
console.log(error)
alert('Error: could not start the file upload. See console log for details.')
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not start the file upload. See console for details.')
})
},
......@@ -1097,7 +1099,7 @@ export default {
})
flow.on('fileError', function(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.upload()
......@@ -1117,9 +1119,9 @@ export default {
// ideally we should refine this so that every single file gets updated independently)
//this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 100)
}).catch(error => {
console.log('Error:')
console.log(error)
alert('Error: could not start the file upload. See console log for details.')
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not start the file upload. See console for details.')
})
},
......@@ -1178,8 +1180,9 @@ export default {
}
}
}).catch(error => {
console.log(error)
alert('There was an error fetching current imports. See console for details.')
console.log('Error: ' + error.response.status + ' ' + error.response.statusText)
console.log(error.response)
alert('Error: could not fetch current imports. See console for details.')
})
},
......@@ -1202,7 +1205,9 @@ export default {
this.files = response.data.results
this.loaded.files = true
}).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 {
this.playlists = response.data.results
this.loaded.playlists = true
}).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.')
})
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment