Catch exceptions while initializing.