Error handle for redifinition and error type