# Buggy code
def UpdateNumberOfErrors(self, number_of_consumed_errors, number_of_produced_errors):
    """Updates the number of errors.

    Args:
      number_of_consumed_errors (int): total number of errors consumed by
          the process.
      number_of_produced_errors (int): total number of errors produced by
          the process.

    Returns:
      bool: True if either number of errors has increased.

    Raises:
      ValueError: if the consumer or produced number of errors is smaller
          than the value of the previous update.
    """
    if number_of_consumed_errors < self.number_of_consumed_errors:
        raise ValueError("Number of consumed errors smaller than previous update.")

    if number_of_produced_errors < self.number_of_produced_errors:
        raise ValueError("Number of produced errors smaller than previous update.")

    consumed_errors_delta = number_of_consumed_errors - self.number_of_consumed_errors

    self.number_of_consumed_errors = number_of_consumed_errors
    self.number_of_consumed_errors_delta = consumed_errors_delta

    produced_errors_delta = number_of_produced_errors - self.number_of_produced_errors

    self.number_of_produced_errors = number_of_produced_errors
    self.number_of_produced_errors_delta = produced_errors_delta

    return consumed_errors_delta > 0 or produced_errors_delta > 0


# Traceback (ValueError)
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/multi_processing/engine.py", line 688, in _StatusUpdateThreadMain
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/multi_processing/engine.py", line 225, in _CheckStatusWorkerProcess
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/multi_processing/engine.py", line 865, in _UpdateProcessingStatus
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/engine/processing_status.py", line 321, in UpdateWorkerStatus
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/engine/processing_status.py", line 236, in _UpdateProcessStatus
File "/usr/local/lib/python2.7/dist-packages/plaso-1.4.1_20160717-py2.7.egg/plaso/engine/processing_status.py", line 166, in UpdateNumberOfEventSources
ValueError: Number of produced sources smaller than previous update.

# Fixed code
def UpdateNumberOfErrors(self, number_of_consumed_errors, number_of_produced_errors):
    """Updates the number of errors.

    Args:
      number_of_consumed_errors (int): total number of errors consumed by
          the process.
      number_of_produced_errors (int): total number of errors produced by
          the process.

    Returns:
      bool: True if either number of errors has increased.

    Raises:
      ValueError: if the consumer or produced number of errors is smaller
          than the value of the previous update.
    """
    consumed_errors_delta = 0
    if number_of_consumed_errors is not None:
        if number_of_consumed_errors < self.number_of_consumed_errors:
            raise ValueError("Number of consumed errors smaller than previous update.")

        consumed_errors_delta = (
            number_of_consumed_errors - self.number_of_consumed_errors
        )

        self.number_of_consumed_errors = number_of_consumed_errors
        self.number_of_consumed_errors_delta = consumed_errors_delta

    produced_errors_delta = 0
    if number_of_produced_errors is not None:
        if number_of_produced_errors < self.number_of_produced_errors:
            raise ValueError("Number of produced errors smaller than previous update.")

        produced_errors_delta = (
            number_of_produced_errors - self.number_of_produced_errors
        )

        self.number_of_produced_errors = number_of_produced_errors
        self.number_of_produced_errors_delta = produced_errors_delta

    return consumed_errors_delta > 0 or produced_errors_delta > 0