implemented error handling for mining task