Skip to content

Commit

Permalink
Add ESLint No Useless Catch Rules
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Jul 6, 2020
1 parent b8a022c commit 37e0e5f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/store/actions/authActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const loginAction = (user) => {
console.log("USER", user);
console.log("run action");
return (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
console.log(intel);
Expand Down Expand Up @@ -64,6 +65,7 @@ const loginAction = (user) => {
*/
const logoutAction = () => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const session = intel.snekclient.session;
Expand Down
4 changes: 4 additions & 0 deletions src/store/actions/generalActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
const appendSourceObjectsAction = (sourceList) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();

Expand Down Expand Up @@ -35,6 +36,7 @@ const appendSourceObjectsAction = (sourceList) => {
*/
const fetchGitLabServersAction = () => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const session = intel.snekclient.session;
Expand Down Expand Up @@ -77,6 +79,7 @@ const fetchGitLabServersAction = () => {
*/
const getDataAction = () => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();

Expand Down Expand Up @@ -106,6 +109,7 @@ const getDataAction = () => {
*/
const getAllPageUrlsAction = () => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
console.log("getAllPageUrlsAction");
const intel = getIntel();
Expand Down
8 changes: 8 additions & 0 deletions src/store/actions/userActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import sha256 from "js-sha256";
*/
const registerAction = (registrationData) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const session = intel.snekclient.session;
Expand Down Expand Up @@ -86,6 +87,7 @@ const registerAction = (registrationData) => {
*/
const writeCacheAction = (platformData) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const session = intel.snekclient.session;
Expand Down Expand Up @@ -122,6 +124,7 @@ const writeCacheAction = (platformData) => {
*/
const readCacheAction = (username) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const session = intel.snekclient.session;
Expand Down Expand Up @@ -230,6 +233,7 @@ const readCacheAction = (username) => {
*/
const updateCacheAction = (fetchedUser) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const session = intel.snekclient.session;
Expand Down Expand Up @@ -301,6 +305,7 @@ const updateCacheAction = (fetchedUser) => {
*/
const saveSettingsActions = (nextSettings) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
console.log("save settings");
const intel = getIntel();
Expand Down Expand Up @@ -411,6 +416,7 @@ const saveSettingsActions = (nextSettings) => {
*/
const getTalkAction = (uid, username) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const session = intel.snekclient.session;
Expand Down Expand Up @@ -465,6 +471,7 @@ const getTalkAction = (uid, username) => {
*/
const uploadTalkAction = (file, talkInfo) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const state = getState();
Expand Down Expand Up @@ -512,6 +519,7 @@ const uploadTalkAction = (file, talkInfo) => {
*/
const deleteTalkAction = (talk) => {
return async (dispatch, getState, { getIntel }) => {
/*eslint no-useless-catch: "error"*/
try {
const intel = getIntel();
const state = getState();
Expand Down

0 comments on commit 37e0e5f

Please sign in to comment.