Skip to content

Commit

Permalink
fix: handles media folders not found error (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
gweiying authored May 12, 2021
1 parent 5a73a89 commit af42723
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion routes/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ async function listDirectoryContent (req, res, next) {
const IsomerDirectory = new Directory(accessToken, siteName)
const folderType = new FolderType(decodedPath)
IsomerDirectory.setDirType(folderType)
const directoryContents = await IsomerDirectory.list()
let directoryContents = []
try {
directoryContents = await IsomerDirectory.list()
} catch (err) {
console.log(err)
}
res.status(200).json({ directoryContents })
}

Expand Down

0 comments on commit af42723

Please sign in to comment.