Fix exception parameters

Adds named parameters to exception handling