Moved exception to new syntax (using "as" keyword)