Skip to content

Commit

Permalink
Add helpful error message if no filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Nov 10, 2015
1 parent 533a3f1 commit 1619a09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/utils/getFromDisk$.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { Observable } from 'rx';
const basePath = process.cwd() + '/seed/challenges/';

export default function getFromDisk$(challenge) {
if (challenge && !challenge.fileName) {
throw new Error(
`Challenge ${challenge.name} has no fileName.
Did you remember run node seed?`
);
}
delete require.cache[require.resolve(
path.join(basePath, challenge.fileName)
)];
Expand Down

0 comments on commit 1619a09

Please sign in to comment.