ACTIV-25 - Fix exception creation

Exceptions created when needed which means the stack trace
will be correct.