Adding file with custom exception