Skip to content

Commit

Permalink
fix(error): add info in database error messages (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdebon committed Nov 23, 2022
1 parent 306b8a2 commit 1d7db30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
20 changes: 10 additions & 10 deletions libs/domains/application/src/lib/slices/application.actions.ts
Expand Up @@ -44,9 +44,9 @@ export const postApplicationActionsRestart = createAsyncThunk<
}

return response
} catch (err: any) {
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Redeploying error', err.message)
return toast(ToastEnum.ERROR, 'Redeploying error', (err as Error).message)
}
})

Expand Down Expand Up @@ -79,9 +79,9 @@ export const postApplicationActionsDeploy = createAsyncThunk<
}

return response
} catch (err: any) {
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Deploying error', err.message)
return toast(ToastEnum.ERROR, 'Deploying error', (err as Error).message)
}
})

Expand All @@ -101,9 +101,9 @@ export const postApplicationActionsDeployByCommitId = createAsyncThunk<
}

return response
} catch (err: any) {
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Deploying error', err.message)
return toast(ToastEnum.ERROR, 'Deploying error', (err as Error).message)
}
})

Expand Down Expand Up @@ -136,9 +136,9 @@ export const postApplicationActionsStop = createAsyncThunk<
}

return response
} catch (err: any) {
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Stopping error', err.message)
return toast(ToastEnum.ERROR, 'Stopping error', (err as Error).message)
}
})

Expand All @@ -162,8 +162,8 @@ export const deleteApplicationAction = createAsyncThunk<
}

return response
} catch (err: any) {
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Deleting error', err.message)
return toast(ToastEnum.ERROR, 'Deleting error', (err as Error).message)
}
})
9 changes: 4 additions & 5 deletions libs/domains/database/src/lib/slices/database.actions.ts
Expand Up @@ -21,7 +21,7 @@ export const postDatabaseActionsRestart = createAsyncThunk<any, { environmentId:
return response
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Redeploying error')
return toast(ToastEnum.ERROR, 'Redeploying error', (err as Error).message)
}
}
)
Expand All @@ -41,7 +41,7 @@ export const postDatabaseActionsDeploy = createAsyncThunk<any, { environmentId:
return response
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Deploying error')
return toast(ToastEnum.ERROR, 'Deploying error', (err as Error).message)
}
}
)
Expand All @@ -61,7 +61,7 @@ export const postDatabaseActionsStop = createAsyncThunk<any, { environmentId: st
return response
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Stopping error')
return toast(ToastEnum.ERROR, 'Stopping error', (err as Error).message)
}
}
)
Expand All @@ -80,8 +80,7 @@ export const deleteDatabaseAction = createAsyncThunk<any, { environmentId: strin

return response
} catch (err) {
// error message
return toast(ToastEnum.ERROR, 'Deleting error')
return toast(ToastEnum.ERROR, 'Deleting error', (err as Error).message)
}
}
)

0 comments on commit 1d7db30

Please sign in to comment.