Debug exception handling