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

Refactor/try catch unknown #1162

Merged
merged 5 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rethrow same error after logging
  • Loading branch information
tomrule007 committed Oct 25, 2021
commit ccd332107255a098f315a85bb3a83781bd6a6b9e
4 changes: 2 additions & 2 deletions helpers/controllers/alertController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const addAlert = async (
return alerts()
} catch (err) {
req.error(['Invalid data for alert creation', arg])
throw new Error(err)
throw err
}
}

Expand All @@ -45,6 +45,6 @@ export const removeAlert = async (
}
} catch (err) {
req.warn(['Error deleting alert', arg])
throw new Error(err)
throw err
}
}
2 changes: 1 addition & 1 deletion helpers/controllers/starsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ export const setStar = async (
return { success: true }
} catch (err) {
req.error(`Failed to add Star into Database: ${err}`)
throw new Error(err)
throw err
}
}