Merge branch 'report-errors-from-json' into 'master'
Report errors from requests with the error json property See merge request pleroma/admin-fe!47
This commit is contained in:
commit
f2c2a95989
1 changed files with 6 additions and 1 deletions
|
@ -11,8 +11,13 @@ service.interceptors.response.use(
|
|||
response => response,
|
||||
error => {
|
||||
console.log('Error ' + error)
|
||||
console.log(error.response.data)
|
||||
|
||||
// If there's an "error" property in the json, use it
|
||||
const edata = error.response.data.error ? error.response.data.error : error.response.data
|
||||
|
||||
Message({
|
||||
message: `${error.message} - ${error.response.data}`,
|
||||
message: `${error.message} - ${edata}`,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue