fix directives pattern and add test for exceptions
Merge pull request #8 from igas/formatter-exceptions

fix directives pattern and add test for exceptions