Error and mistakes are two words that are similar in meaning. You can use them interchangeably most times, but not always, as their extent of usage with respect to the kind of sentence constructed is different. In most cases, the error is considered to be more severe than a mistake when referring to the extent of fault or wrong that occurred. However, the mistake is more generally used among people, which indicates that mistake is mostly casually used.
This is unlike error, which is usually used and more suitable for technical, computing, scientific, formal, and programming usage. If you are familiar with computing, you will notice that hardly will you see a mistake being used, but instead, you see the error. Another key difference between these two words is their origins. Error is derived from the Latin word "errare" or "errorem," which means to stray or to wander. On the other hand, 0mistake is gotten from two Old Norse words "mis," which means "wrong," and "taka" which means "take."