A sample processing apparatus comprises an aspirating member which comprises a pump at one side and which is configured to aspirate a sample from the other side, a sensor which is configured to sense the presence or absence of a liquid at a predetermined position of the aspirating member, and a controller which is programmed to execute operations. The operations comprise controlling the aspirating member to aspirate a sample, obtaining a first sensing result by the sensor when the aspirating member aspirates a sample, controlling the aspirating member to aspirate air after aspirating a sample, obtaining a second sensing result by the sensor when the aspirating member aspirates air, and detecting an error in the aspirating operation, based on the first sensing result and the second sensing result.