Skip to content

Commit

Permalink
chore(#20): add a change to catch
Browse files Browse the repository at this point in the history
  • Loading branch information
IsabelleMello committed May 16, 2020
1 parent ad88092 commit 46720da
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/services/ConsultationDialogueService.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ module.exports = async (req, res) => {
});
return res.status(200).json(response);
} catch (err) {
if (err.name === "ValidationError") {
res.status(400).json({ error: err.message });
} else {
res.status(500).json({ error: "Dialog consultation failed" });
}
return err.name === "ValidationError"
? res.status(400).json({ error: err.message })
: res.status(500).json({ error: "Dialog consultation failed" });
}
};

0 comments on commit 46720da

Please sign in to comment.