A 'mistake' is usually accidental, you know it is wrong. Otherwise, an 'error' is usually made due to the lack of knowledge and is more formal than 'mistake'. "Machines never make mistakes, but rather they make errors. People can make both."