Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(error): add info in database error messages #386

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)
}
}
)