TsLint: More cleanner error handling.
Fixes issues #455 and #456.
Merge pull request #457 from am11/master

TsLint: More cleanner error handling