public static function setupErrorHandling($mode) {
        if     ($mode === self::LOG_ERRORS      ) self::$errorMode = self::LOG_ERRORS;
        elseif ($mode === self::THROW_EXCEPTIONS) self::$errorMode = self::THROW_EXCEPTIONS;
        else                                      return null;

        return set_error_handler(self::$errorHandler=__CLASS__.'::handleError', error_reporting());
    }