Need to make try and except clause more spesific to catch right errors

Need to make try and except clause more spesific to catch right errors especially at the os.makedirs part of the code.