1. A data processing apparatus comprising: a storage unit configured to store a plurality of data processing programs and a corresponding error processing program for when an error occurs with a first data processing program; and a processor configured to: record to memory before executing the first data processing program, information of the error processing program that corresponds to the first data processing program, update and record in the memory after the first data processing program ends, information of a second data processing program scheduled to be executed next, and switch to any one among the first data processing program that corresponds to information recorded in the memory and the error processing program, when program processing is started next.