avoiding usage of deprecated exception attribute