andrewdavey / knapsack

Project moved to https://github.com/andrewdavey/cassette
MIT License
24 stars 3 forks source link

Better exception messages #8

Closed jochenjonc closed 13 years ago

jochenjonc commented 13 years ago

It's not a big issue, but I've had the 'The given key was not present in the dictionary' exception a few times and it always takes me a while to find where I have a wrong tag or in what module.txt I made an error.

The exception should be more like:

The script file jquery-1.6.0.js referenced in mycustom.js could not be found. In order to solve this, put the jquery-1.6.0.js in a module or rename the reference to a file that does exist.

It's not a high priority issue, but I it will help people in using Knapsack.

andrewdavey commented 13 years ago

I've pushed a fix for this. You should now see a much more useful message.

This commit also has nicer handling of exceptions thrown during Knapsack initialization. So it's now possible to fix a broken script reference, for example, then just refresh the web browser page to see the result. (Rather than force the web application to restart).

jochenjonc commented 13 years ago

Tested and it works, nice job.