aboutsummaryrefslogtreecommitdiffhomepage
path: root/api/routes/github.js
diff options
context:
space:
mode:
Diffstat (limited to 'api/routes/github.js')
-rw-r--r--api/routes/github.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/api/routes/github.js b/api/routes/github.js
index 5c4456e..a1f23b4 100644
--- a/api/routes/github.js
+++ b/api/routes/github.js
@@ -10,7 +10,8 @@ const {
fetchKeyboardFiles,
createOauthFlowUrl,
createOauthReturnUrl,
- commitChanges
+ commitChanges,
+ InvalidRepoError,
} = require('../services/github')
const { parseKeymap } = require('../services/zmk/keymap')
@@ -88,6 +89,12 @@ const getKeyboardFiles = async (req, res, next) => {
keyboardFiles.keymap = parseKeymap(keyboardFiles.keymap)
res.json(keyboardFiles)
} catch (err) {
+ if (err instanceof InvalidRepoError) {
+ return res.status(400).json({
+ error: 'InvalidRepoError'
+ })
+ }
+
next(err)
}
}