<commit_before>package titleservice

import "errors"

var (
	// ErrUnexpectedContentType is returned if response isn't JSON
	ErrUnexpectedContentType = errors.New("unexpected Content-Type")

	// ErrMissingParameter is returned if missing a parameter required by the MMS TitleService API
	ErrMissingParameter = errors.New("missing parameter")

	// ErrInvalidParameter is returned if a parameter is invalid for some reason
	ErrInvalidParameter = errors.New("invalid parameter")
)

// newErrorWithMessage annotates err with a new message.
// If err is nil, newErrorWithMessage returns nil.
func newErrorWithMessage(err error, msg string) error {
	if err == nil {
		return nil
	}

	return &errorWithMessage{
		cause: err,
		msg:   msg,
	}
}

type errorWithMessage struct {
	cause error
	msg   string
}<commit_msg>New errors ErrNoUsername and ErrNoPassword<commit_after>package titleservice

import "errors"

var (
	// ErrUnexpectedContentType is returned if response isn't JSON
	ErrUnexpectedContentType = errors.New("unexpected Content-Type")

	// ErrMissingParameter is returned if missing a parameter required by the MMS TitleService API
	ErrMissingParameter = errors.New("missing parameter")

	// ErrInvalidParameter is returned if a parameter is invalid for some reason
	ErrInvalidParameter = errors.New("invalid parameter")

	// ErrNoUsername is returned if username is empty
	ErrNoUsername = errors.New("no username")

	// ErrNoPassword is returned if password is empty
	ErrNoPassword = errors.New("no password")
)

// newErrorWithMessage annotates err with a new message.
// If err is nil, newErrorWithMessage returns nil.
func newErrorWithMessage(err error, msg string) error {
	if err == nil {
		return nil
	}

	return &errorWithMessage{
		cause: err,
		msg:   msg,
	}
}

type errorWithMessage struct {
	cause error
	msg   string
}
{'fraction_non_alphanumeric': 0.0718562874251497, 'fraction_numerical': 0.0, 'mean_word_length': 4.552870090634441, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2844135', 'n_tokens_mistral': 519, 'n_tokens_neox': 495, 'n_words': 190}