1. A data processing apparatus comprising: a storage configured to store a plurality of data processing programs and an error processing program corresponding to a first data processing program among the plurality of data processing programs, for when an error occurs with the first data processing program; and a processor configured to: record to a 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 executing of the first data processing program ends, information of a second data processing program scheduled to be executed next, the second data processing program being among the plurality of data processing programs, and switch to any one among the second data processing program and the error processing program based on the information recorded in the memory, when program processing is next started.