package bin

import 

// InvalidLengthError is returned when decoder reads invalid length.
type InvalidLengthError struct {
	Length int
	Where  string
}

func ( *InvalidLengthError) () string {
	return fmt.Sprintf("invalid %s length: %d", .Where, .Length)
}

// UnexpectedIDErr means that unknown or unexpected type id was decoded.
type UnexpectedIDErr struct {
	ID uint32
}

func ( *UnexpectedIDErr) () string {
	return fmt.Sprintf("unexpected id %#x", .ID)
}

// NewUnexpectedID return new UnexpectedIDErr.
func ( uint32) error {
	return &UnexpectedIDErr{ID: }
}