The usual form would be will occur, because the program will do the same thing for the same input. As this is habitual, it's also common to see present tense: occurs.
Which modal verb you choose depends on what you want to emphasise:
- Use can to emphasise that the program is capable of detecting some error. "The program can generate an error if the input is nonsensical, such as a temperature below 0 Kelvin"
- Use will or does to emphasise that the program is certain to detect something: "The program will generate an error if you enter a negative number". (Also habitual present tense: "The program generates an error ...")
- Use may or might for uncertainty. It's a shade of meaning, but "may" leans towards "ignorance" and "might" leans towards "probabilistic". "The protocols may generate error conditions" and "Some packets might be lost and cause errors".
Here's an example sentence which uses them all: "As internet packets might be reordered, duplicated, or lost, and the remote system may have bugs, our program can detect these conditions when they occur and will generate error messages on unacceptable data."
Note that while statisticians, physicists etc normally use "data" as plural, with singular "datum", computer programmers almost always use "data" as uncountable. Statisticians: "The data are incorrect because the last datum is erroneous"; Programmers: "The data is incorrect because the last input is erroneus".