diff options
Diffstat (limited to 'api/routes/github.js')
-rw-r--r-- | api/routes/github.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/api/routes/github.js b/api/routes/github.js index 19d87ad..9594b5c 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) } } |