Skip to content

Commit

Permalink
LF-3881 Add missing console.error() statements in controller catch bl…
Browse files Browse the repository at this point in the history
…ocks
  • Loading branch information
kathyavini committed Dec 4, 2023
1 parent 403b538 commit 7c6c047
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/api/src/controllers/cropVarietyController.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const cropVarietyController = {
const result = await CropVarietyModel.query().whereNotDeleted().where({ farm_id });
return res.status(200).send(result);
} catch (error) {
console.error(error);
return res.status(400).json({ error });
}
};
Expand All @@ -32,6 +33,7 @@ const cropVarietyController = {
? res.status(200).send(result)
: res.status(404).send('Crop variety not found');
} catch (error) {
console.error(error);
return res.status(400).json({ error });
}
};
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/controllers/documentController.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const documentController = {
.patch({ archived: req.body.archived });
return result ? res.sendStatus(200) : res.status(404).send('Document not found');
} catch (error) {
console.error(error);
return res.status(400).json({ error });
}
};
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/controllers/insightController.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ const insightController = {
res.status(200).send({});
}
} catch (error) {
console.error(error);
res.status(400).json({ error });
}
};
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/controllers/managementPlanController.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ const managementPlanController = {
? res.status(200).send(removeCropVarietyFromManagementPlans(managementPlans))
: res.status(404).send('Field crop not found');
} catch (error) {
console.error(error);
res.status(400).json({ error });
}
};
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/controllers/organicHistoryController.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default {
const result = await OrganicHistoryModel.query().context(req.auth).insert(req.body);
return res.status(201).send(result);
} catch (error) {
console.error(error);
return res.status(400).json({ error });
}
};
Expand All @@ -36,6 +37,7 @@ export default {
? res.status(200).send(result)
: res.status(404).send('Organic history not found');
} catch (error) {
console.error(error);
return res.status(400).json({ error });
}
},
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/controllers/taskController.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const taskController = {
}
return res.status(404).send('Tasks not found');
} catch (error) {
console.error(error);
return res.status(400).json({ error });
}
},
Expand Down Expand Up @@ -813,6 +814,7 @@ const taskController = {

return res.status(200).send(result);
} catch (error) {
console.error(error);
return res.status(400).json({ error });
}
},
Expand Down

0 comments on commit 7c6c047

Please sign in to comment.