Extremely hacky fix for finding error type