Add trace to exception handling