Add errors class for main functions.