horsdal / Nancy.Linker

Simple URI builder for named Nancy routes
MIT License
13 stars 2 forks source link

Better error for missing Route Name #6

Closed Crisfole closed 9 years ago

Crisfole commented 9 years ago

Right now if you try to link to a route name that doesn't exist yet you get an InvalidOperationException because Single fails when trying to find the route.

It would be nice to have a better exception that told you what route couldn't be found.

horsdal commented 9 years ago

Would you be up for doing a PR? I guess it a matter of doing a .Any(...) check before this line https://github.com/horsdal/Nancy.Linker/blob/master/src/Nancy.Linker/ResourceLinker.cs#L42...

Crisfole commented 9 years ago

Haven't installed C#6 yet and so had trouble compiling. I can certainly try, but i can't guarantee it'll compile :)

horsdal commented 9 years ago

VS2015 CTP should give you C#6. But if don't want to install that, I'll fix it.

Crisfole commented 9 years ago

I'll go grab it. So long as it doesn't step on my current VS install, then I'm cool with that. Thanks for the poitner. I've wanted to play w/ C#6 for a while now. Now I have an excuse! :)

horsdal commented 9 years ago

:cool: :sunglasses: