Added exception handling for labelAPI preprocessor