gru: fix bug in exception handling